Skip to content

codegen: create a file per model#5365

Open
hughsimpson wants to merge 11 commits into
softwaremill:masterfrom
hughsimpson:file_per_model_2
Open

codegen: create a file per model#5365
hughsimpson wants to merge 11 commits into
softwaremill:masterfrom
hughsimpson:file_per_model_2

Conversation

@hughsimpson

@hughsimpson hughsimpson commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Should address #5287

Relevant changes are clearer after #5366 which commits some incidental refactoring

Adds a new openapiSeperateFilesForModels flag with default false so as not to needlessly break user code (my downstream refactor after enabling this was mostly just find+replace, but still chonky and with edge-cases)

The nifi_test now uses this new flag; it's a pretty large spec, so this provides good coverage, whilst also reducing the number of lines in our expectations (this is the sole reason for the diff having more deleted lines than added).

Writing the output files gets wrapped in a Future.traverse now because writing >1000 model files can be slower than it needs to be, otherwise.

Type aliases are now sorted alphabetically in output.

Inline enums now get written immediately after the 'container' object, rather than at the start of the file. This wasn't a particularly intentional change, but it aligns with the fact that, when 'splitting' to separate files, inline defns will live with the parent. The ordering change should have no impact on user code (although it did cause a bit of churn in test expectations...)

Incidentally fixes an issue with 'deduplicated' file structure when using zio or circe serdes and reusing a json-y Map[String T] or Array[T] type alias

@hughsimpson hughsimpson marked this pull request as ready for review June 29, 2026 10:39
@hughsimpson hughsimpson changed the title codegen: create a file per model (WIP) codegen: create a file per model Jun 29, 2026
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.

1 participant