Skip to content

Conversation

@mnahkies
Copy link
Owner

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

@mnahkies mnahkies merged commit f2d6b8a into main Dec 20, 2025
22 checks passed
@mnahkies mnahkies deleted the mn/refactor/move-virtual-schemas branch December 20, 2025 12:36
mnahkies added a commit that referenced this pull request Dec 20, 2025
now that request bodies are always extracted as named schemas (after
#398),
we don't need the additional local variable that previously held
the definitions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants