-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support additional properties for openapi-generator #1427
Add support additional properties for openapi-generator #1427
Conversation
0593509
to
c091b64
Compare
c091b64
to
afadb42
Compare
afadb42
to
4e33463
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you include tests?
@sdelamo Well, what can I say, if I write a regular unit test, then it will not be testing our generator, but the openapi-generator library, because it performs all these functions. I'm not sure it's worth spending time on this. I just added the ability to set these parameters through the configuration so that the user can set them through the plugin. So, in order to fully test this mapping, you need to put all these properties in the gradle, but because of this, the generated code will completely change - all class names, mapping to other schemes, etc. If you add these settings to existing test suites, you will have to completely recycle them, because absolutely all names will change and the main the problem is, the generated code will simply be difficult to match with the source file. I checked all this locally, everything worked out correctly, added only one property to the test - nameMapping = [test: "changedTest"] because it affects only one class. Prefixes and suffixes affect absolutely all generated code |
f251bb7
to
9781d81
Compare
Add support additional properties for openapi-generator: schemaMapping importMapping nameMapping typeMapping enumNameMapping modelNameMapping inlineSchemaNameMapping inlineSchemaOption openapiNormalizer apiNamePrefix apiNameSuffix modelNamePrefix modelNameSuffix Fixed micronaut-projects#1421
9781d81
to
f72b657
Compare
if (options.openapiNormalizer != null) { | ||
javaCodeGen.addOpenapiNormalizer(options.openapiNormalizer); | ||
} | ||
if (options.apiNamePrefix != null && !options.apiNamePrefix.isBlank()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a utils class StringUtils::isNotBlank
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, but this module does not depend on the libraries of the micronaut. It depends only on the openapi-generator
Set stability level to STABLE for generators.
Add support additional properties for openapi-generator:
schemaMapping
importMapping
nameMapping
typeMapping
enumNameMapping
modelNameMapping
inlineSchemaNameMapping
inlineSchemaOption
openapiNormalizer
apiNamePrefix
apiNameSuffix
modelNamePrefix
modelNameSuffix
Fixed #1421