Commit f2d6b8a
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, sorry1 parent 1280cdf commit f2d6b8a
88 files changed
Lines changed: 146458 additions & 141129 deletions
File tree
- e2e/src/generated
- client
- axios
- fetch
- server
- express
- routes
- koa
- routes
- integration-tests
- typescript-angular/src/generated
- api.github.com.yaml
- okta.idp.yaml
- todo-lists.yaml
- typescript-axios/src/generated
- api.github.com.yaml
- okta.idp.yaml
- stripe.yaml
- todo-lists.yaml
- typescript-express/src/generated
- api.github.com.yaml
- azure-core-data-plane-service.tsp
- azure-resource-manager.tsp
- okta.idp.yaml
- okta.oauth.yaml
- petstore-expanded.yaml
- stripe.yaml
- todo-lists.yaml
- typescript-fetch/src/generated
- api.github.com.yaml
- okta.idp.yaml
- stripe.yaml
- todo-lists.yaml
- typescript-koa/src/generated
- api.github.com.yaml
- azure-core-data-plane-service.tsp
- azure-resource-manager.tsp
- okta.idp.yaml
- okta.oauth.yaml
- petstore-expanded.yaml
- stripe.yaml
- todo-lists.yaml
- packages/openapi-code-generator/src
- core
- typescript
- client
- common/schema-builders
- server
- typescript-koa
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments