Skip to content

Commit f2d6b8a

Browse files
authored
feat!: move virtual schemas (#398)
this is an annoying but necessary change that is blocking a number of improvements. in essence we are moving the responsibility for generating "virtual schemas", ie: giving a name to otherwise anonymous entities into the `Input` class, and making the `OpenapiLoader` instance private, as it always should've been. this is a step towards more clearly delimiting between the internal domain model and the external (eg: OAS) domain model, which is going to unlock improvements to support for 3.1 / 3.2 functionality. unfortunately, this also identified that there were some inconsistencies in the names being generated, and despite my best efforts I wasn't able to come up with a clean way to preserve the original names. given that it was going to be a breaking change anyway, I've doubled-down a bit and allowed myself to further change the names, notably omitting the media type if only a single media type is defined by the specification in that context (eg: there is no ambiguity by omitting it) this change also "unwraps" some types that were adding needless indirection, eg: ``` type SomeModel = {...} type SomeRequestBody = SomeModel ``` will now just directly reference `SomeModel` where needed. whilst not yet exposed through the CLI, it also internally introduces a `SyntheticNameGenerator` interface that will later be exposed in some way to allow users to customize the names generated going forward. BREAKING CHANGE: generated names of some output types/schemas have changed, sorry
1 parent 1280cdf commit f2d6b8a

88 files changed

Lines changed: 146458 additions & 141129 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

e2e/src/generated/client/axios/client.ts

Lines changed: 14 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/src/generated/client/axios/models.ts

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/src/generated/client/axios/schemas.ts

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/src/generated/client/fetch/client.ts

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/src/generated/client/fetch/models.ts

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/src/generated/client/fetch/schemas.ts

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/src/generated/server/express/models.ts

Lines changed: 8 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/src/generated/server/express/routes/media-types.ts

Lines changed: 3 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)