Skip to content

Conversation

@Ghufz
Copy link
Contributor

@Ghufz Ghufz commented Jun 26, 2020

ConvertTo-Josn unable to process the nested objects which are more than two level inside, it treats the whole object as string. Parameter Depth is used to control the nested element processing.

Problem :-

PS C:> $response.ActualInstance.Results[0].Organization.GetType().Name
String

Correct One:

PS C:> $response.ActualInstance.Results[0].Organization.GetType()
PSCustomObject

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/config/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.
    @wing328

@wing328
Copy link
Member

wing328 commented Jun 26, 2020

Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors.

Let me know if you need help fixing it.

Ref: https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-can-i-update-commits-that-are-not-linked-to-my-github-account

@Ghufz Ghufz force-pushed the ps-jsonDepthFixRevised branch from 0ea88dc to 1ecc63e Compare June 26, 2020 09:07
@wing328 wing328 merged commit f114294 into OpenAPITools:master Jun 27, 2020
@wing328 wing328 changed the title Response was unable to process nested json object more than 2 level Fix issues when processing nested json object more than 2 level Jun 27, 2020
@wing328 wing328 added this to the 5.0.0 milestone Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants