fix: remove the single use of a union type in the api#107
Open
eseidel wants to merge 1 commit intoSpaceTradersAPI:mainfrom
Open
fix: remove the single use of a union type in the api#107eseidel wants to merge 1 commit intoSpaceTradersAPI:mainfrom
eseidel wants to merge 1 commit intoSpaceTradersAPI:mainfrom
Conversation
Union types are easy in typescript, but harder in languages like rust, c++, dart, etc. The Dart openapi generator doesn't currently support oneOf (that could be fixed), and since this is the only place it's used it seems like a low cost to remove it. The cost is mild ergnomics for easier generation by language that lack union types (at least with generators that generate a type for every argument declaration).
Contributor
Author
|
This was removed for a while, but just added back again. 😦 Would love to see it removed again (just go back to accepting the array) so I don't have to teach my generator about anyOf for this one case. 🙃 |
This file contains hidden or 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
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.
Union types are easy in typescript, but harder in languages
like rust, c++, dart, etc. The Dart openapi generator doesn't
currently support oneOf (that could be fixed), and since this is
the only place it's used it seems like a low cost to remove it.
The cost is mild ergnomics for easier generation by language that
lack union types (at least with generators that generate a type
for every argument declaration).