scalar / openapi-parser

Modern OpenAPI parser written in TypeScript
MIT License
34 stars 1 forks source link

feat(openapi-parser): expose more types under the OpenAPI namespace #162

Closed hanspagel closed 3 months ago

hanspagel commented 3 months ago

I find myself often using something like

  path?:
    | OpenAPIV2.PathItemObject
    | OpenAPIV3.PathItemObject
    | OpenAPIV3_1.PathItemObject

But some types were already exposed under the OpenAPI namespace, e. g. OpenAPI.Operation. This PR exposes more types, not all but the ones I find myself working with a lot. Allows to just do this:

  path?: OpenAPI.PathItemObject

Which should also make it easier to add OpenAPI 3.2/4.0 at some point.

changeset-bot[bot] commented 3 months ago

πŸ¦‹ Changeset detected

Latest commit: e5b68e2323ee358a84e1d798a7f004749d08b06d

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

relativeci[bot] commented 3 months ago

#128 Bundle Size β€” 74.91KiB (0%).

e5b68e2(current) vs b78d593 main#127(baseline)

Bundle metrics  no changes
                 Current
#128
     Baseline
#127
No change  Initial JS 74.91KiB 74.91KiB
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 45 45
No change  Assets 45 45
No change  Modules 45 45
No change  Duplicate Modules 0 0
No change  Duplicate Code 0% 0%
No change  Packages 0 0
No change  Duplicate Packages 0 0

Bundle size by type  no changes
|            |       Current
[#128](https://app.relative-ci.com/projects/hXQ54UQKluDUZAKvpt9b/jobs/128-qgIetDrA1pC9o1EfcUQL?utm_source=github&utm_medium=pr-report "View bundle analysis report") |      Baseline
[#127](https://app.relative-ci.com/projects/hXQ54UQKluDUZAKvpt9b/jobs/127-lGeKXE1Nc55EMI8LudMp?utm_source=github&utm_medium=pr-report "View baseline bundle analysis report") | |:--|--:|--:| | No change  [JS](https://app.relative-ci.com/projects/hXQ54UQKluDUZAKvpt9b/jobs/128-qgIetDrA1pC9o1EfcUQL/assets?ba=%7B%22filters%22%3A%22ft.CSS-0_ft.JS-1_ft.IMG-0_ft.MEDIA-0_ft.FONT-0_ft.HTML-0_ft.OTHER-0%22%7D "View JS assets") | `74.91KiB` | `74.91KiB` |

Bundle analysis report Branch feat/expose-more-types Project dashboard

cloudflare-workers-and-pages[bot] commented 3 months ago

Deploying openapi-parser with  Cloudflare Pages  Cloudflare Pages

Latest commit: e5b68e2
Status: βœ…  Deploy successful!
Preview URL: https://5d78b5d2.openapi-parser.pages.dev
Branch Preview URL: https://feat-expose-more-types.openapi-parser.pages.dev

View logs