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

OpenAPI: Add discriminators #80

Merged
merged 7 commits into from
Oct 17, 2023
Merged

OpenAPI: Add discriminators #80

merged 7 commits into from
Oct 17, 2023

Conversation

spinillos
Copy link
Member

@spinillos spinillos commented Oct 13, 2023

Relates: #58

It adds discriminators for oneOf and anyOf for OpenAPI.

allOf will be in other PR since it needs refactor of references to be able to point to external files.

@spinillos spinillos requested a review from a team as a code owner October 13, 2023 13:31
@@ -59,6 +59,7 @@ func CompilerPasses() []compiler.Pass {
return []compiler.Pass{
&compiler.Unspec{},
&compiler.DashboardPanelsRewrite{},
&compiler.PrefixEnumValues{},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need that for typescript? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I saw the same problem with the integer enums and they are setting number as names and they are invalid.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I think we should probably have a different compiler pass, specifically for that use-case :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is working as expected... what is the difference?

@spinillos spinillos merged commit 90429e0 into main Oct 17, 2023
2 checks passed
@spinillos spinillos deleted the openapi/add-discriminator branch October 17, 2023 10:03
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.

None yet

2 participants