-
Notifications
You must be signed in to change notification settings - Fork 31
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
Lookup schema with discriminator in OpenAPI snippets #1604
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
baywet
previously requested changes
Jun 19, 2023
Kudos, SonarCloud Quality Gate passed! |
baywet
approved these changes
Jun 19, 2023
andrueastman
added a commit
that referenced
this pull request
Jun 20, 2023
* Fix: Use pascal case for issue property key (#1603) * Use pascal case for issue propety key * Update GraphWebApi/Controllers/KnownIssuesController.cs Co-authored-by: Eastman <andrueastman@users.noreply.github.com> --------- Co-authored-by: Eastman <andrueastman@users.noreply.github.com> * Lookup schema with discriminator in OpenAPI snippets (#1604) * Use shared base to reduce code repetition * Looks up dereived types from schema list * Fixes template matching for collections with functions * Fixes Guid parsing * Fixes enum parsing in path parameters * Fix incorrect schema names when looked up from collections * Fix namespaces lookup for collections * Fix code smells * Bump Microsoft.OpenApi from 1.6.4 to 1.6.5 (#1606) Bumps [Microsoft.OpenApi](https://github.com/Microsoft/OpenAPI.NET) from 1.6.4 to 1.6.5. - [Release notes](https://github.com/Microsoft/OpenAPI.NET/releases) - [Commits](microsoft/OpenAPI.NET@1.6.4...1.6.5) --- updated-dependencies: - dependency-name: Microsoft.OpenApi dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump Microsoft.OpenApi.Readers from 1.6.4 to 1.6.5 (#1605) Bumps [Microsoft.OpenApi.Readers](https://github.com/Microsoft/OpenAPI.NET) from 1.6.4 to 1.6.5. - [Release notes](https://github.com/Microsoft/OpenAPI.NET/releases) - [Commits](microsoft/OpenAPI.NET@1.6.4...1.6.5) --- updated-dependencies: - dependency-name: Microsoft.OpenApi.Readers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: EvansA <evansonoka05.j@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR closes #629
It updates the OpenAPI snippet generator to receive the list of schemas in the reference document so as to allow for the lookup of schemas on snippet generation. This assists in the scenario where the node schema defines the base type (e.g.
Attachment
) but the payload defines a derived type(e.g.FileAttachement
) with the properties from the derived type.As the generator only has the types from the base type, it ends up placing the properties of the derived instance in the additionalDAta rather than initialize the derived type and use its propeties.
For example
Should be
As the changes affect the
SnippetCodeGraph
, the fix should apply for all languages using theSnippetCodeGraph
and type information updated.This PR also
For easier review the PR is composed of 2 updates
Generation Diff