Skip to content

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

Merged
merged 10 commits into from
Jun 19, 2023

Conversation

andrewse02
Copy link
Contributor

@andrewse02 andrewse02 commented Jun 19, 2023

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:

  • OpenAPI.Request
  • OpenAPI.Response
  • OpenAPI.Header
  • JSONSchema

Result

New typealiases will be added, decreasing confusion, and increasing symmetry when using OpenAPI types.

Resolves

Resolves #12

Edits

  1. Removed additions of Resolved* typealiases

Copy link
Contributor

@czechboy0 czechboy0 left a 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 🙏

@andrewse02 andrewse02 requested a review from czechboy0 June 19, 2023 06:16
Copy link
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@andrewse02 andrewse02 force-pushed the ae/unresolved-typealiases branch from d587582 to 0a6f78f Compare June 19, 2023 06:22
@simonjbeaumont
Copy link
Collaborator

@andrewse02 thanks for taking the time to clean this up. Just one minor nit from me—otherwise LGTM!

@simonjbeaumont simonjbeaumont enabled auto-merge (squash) June 19, 2023 18:04
@simonjbeaumont simonjbeaumont merged commit 72383b3 into apple:main Jun 19, 2023
@andrewse02 andrewse02 deleted the ae/unresolved-typealiases branch June 19, 2023 23:24
@czechboy0 czechboy0 added the semver/none No version bump required. label Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an Unresolved* typealias for all supported OpenAPI types
3 participants