codegen: create a file per model#5365
Open
hughsimpson wants to merge 11 commits into
Open
Conversation
8742b6d to
bdcc845
Compare
…t that defines them, rather than up front with 'global' enums. Type aliases are ordered alphabetically
…x an xml import issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Should address #5287
Relevant changes are clearer after #5366 which commits some incidental refactoring
Adds a new
openapiSeperateFilesForModelsflag with defaultfalseso 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_testnow 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.traversenow 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