Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add forced casting for Arrays in Remove-NullProperties (#50) #51

Closed
wants to merge 1 commit into from

Conversation

TriggerAu
Copy link
Contributor

This adds a forced cast inside the method that prevents Powershell from converting a single valued array to an object.

This pr does not include changes to the test methods as Im not sure how the team would intend the use case to be tested

Its a revisit on #35

Issue #50

This adds a forced cast inside the method that prevents Powershell from
converting a single valued array to an object.

This pr does not include changes to the test methods as Im not sure how
the team would intend the use case to be tested

Its a revisit on okta#35
@laura-rodriguez
Copy link
Collaborator

Thank you for your contribution, @TriggerAu!

I've filed an internal ticket for the team to review and prioritize.

In the meantime, could you add a unit test to verify this works as expected? -If that's not available to you, that's OK.- We have UTs for this functionality here.

Internal Ref: OKTA-813695

laura-rodriguez added a commit that referenced this pull request Oct 29, 2024
- Update Remove-NullPropertiesFromArray to ensure an array is always returned
- Add tests to verify functionality
- Fix #43
@laura-rodriguez
Copy link
Collaborator

Hi @TriggerAu,

I've included your PR in #58 with some additional changes. You will notice that instead of using Remove-NullProperties in line 38, I ended up using Remove-NullPropertiesFromArray. I've also updated the Remove-NullPropertiesFromArray to ensure we always return an array. Additionally, I added more tests to cover objects created with initializer functions.

Feel free to take a look at the PR, and again, thank you for contributing to the Okta PS module ⭐

laura-rodriguez added a commit that referenced this pull request Oct 30, 2024
- Update Remove-NullPropertiesFromArray to ensure an array is always returned
- Add tests to verify functionality
- Fix #43

Signed-off-by: Laura Rodriguez <[email protected]>
laura-rodriguez added a commit that referenced this pull request Oct 30, 2024
- Update Remove-NullPropertiesFromArray to ensure an array is always returned
- Add tests to verify functionality
- Fix #43

Signed-off-by: Laura Rodriguez <[email protected]>
laura-rodriguez added a commit that referenced this pull request Oct 30, 2024
- Update Remove-NullPropertiesFromArray to ensure an array is always returned
- Add tests to verify functionality
- Fix #43

Signed-off-by: Laura Rodriguez <[email protected]>
laura-rodriguez added a commit that referenced this pull request Oct 30, 2024
- Update Remove-NullPropertiesFromArray to ensure an array is always returned
- Add tests to verify functionality
- Fix #43

Signed-off-by: Laura Rodriguez <[email protected]>
@laura-rodriguez
Copy link
Collaborator

Superseded by #58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants