Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

fix(openapi-parser): add TypeScript discriminator strings #159

Merged
merged 4 commits into from
Jul 23, 2024

Conversation

tmcw
Copy link
Contributor

@tmcw tmcw commented Jul 10, 2024

Problem
Currently, it's hard to figure out what version of OpenAPI spec you've got, and the spec types are combined together, which makes it hard to interact with the schema object.

Explanation
This happens because the types for the documents don't have literal version strings, and the way they're combined mushes them together.

Solution
With this PR each OpenAPI version gets a literal version string and the types are combined in a simpler way.

Copy link

changeset-bot bot commented Jul 10, 2024

🦋 Changeset detected

Latest commit: 35e519e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@scalar/openapi-parser Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tmcw tmcw force-pushed the add-version-strings branch from ce55668 to 2549ea4 Compare July 10, 2024 18:29
@tmcw tmcw changed the title Add discriminator strings fix: Add discriminator strings Jul 10, 2024
@hanspagel hanspagel changed the title fix: Add discriminator strings fix(openapi-parser): add TypeScript discriminator strings Jul 23, 2024
Copy link
Member

@hanspagel hanspagel left a comment

Choose a reason for hiding this comment

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

Awesome PR, love it! :) Just added to the comments and updated the changeset.

@marclave marclave merged commit a52eb57 into scalar:main Jul 23, 2024
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenAPI.Document is not a discriminated union and I wish it was one
3 participants