-
Notifications
You must be signed in to change notification settings - Fork 129
Create an Unresolved* typealias for all supported OpenAPI types #74
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
Create an Unresolved* typealias for all supported OpenAPI types #74
Conversation
Sources/_OpenAPIGeneratorCore/Translator/RequestBody/TypedRequestBody.swift
Outdated
Show resolved
Hide resolved
Sources/_OpenAPIGeneratorCore/Translator/TypeAssignment/TypeAssigner.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making all the Unresolved* aliases is great, but as you suggested, let's get rid of the Resolved* aliases, as they create an extra layer of indirection to clear types, like JSONSchema/OpenAPI.Parameter, and so on. Thanks 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
d587582
to
0a6f78f
Compare
Sources/_OpenAPIGeneratorCore/Translator/Parameters/TypedParameter.swift
Show resolved
Hide resolved
Sources/_OpenAPIGeneratorCore/Translator/Responses/TypedResponseHeader.swift
Show resolved
Hide resolved
@andrewse02 thanks for taking the time to clean this up. Just one minor nit from me—otherwise LGTM! |
Motivation
Currently, when referencing OpenAPI types that may not be referenceable, it requires a very long and unintuitive type name (e.g.,
Either<JSONReference<OpenAPI.Request>, OpenAPI.Request>
). We can clean this up, by exposing more usable, and practical typealiases to improve quality of life and speed while working on the generator.Modifications
Added and used
Unresolved*
typaliases for:Result
New typealiases will be added, decreasing confusion, and increasing symmetry when using OpenAPI types.
Resolves
Resolves #12
Edits
Resolved*
typealiases