-
Notifications
You must be signed in to change notification settings - Fork 5
modelNameSuffix #65
Comments
Funny, haven't thought of that. :-) Yes, I guess this would be useful. That way we can avoid the postfix "noise" in the openapi description, which is our current strategy at work.. ;-) |
Wow, seems that you went along and implemented it already? If I can give you a hand or test your solution just give me a mention! |
Started it :-) It does not work yet. I still have a few failing tests. Giving it a test run would be nice, I'll notify you when it is ready to try. |
@aegliv I think it should work now. Tests pass but I haven't tried it on a real project yet. You can try the latest openapi-processor-spring snapshot (2021.4-SNAPSHOT) (or openapi-processor-micronaut 2021.2-SNAPSHOT). Just update the version. The mapping looks like this: openapi-processor-mapping: v2
options:
package-name: generated
model-name-suffix: Resource It will ignore the suffix if the schema already ends with the suffix to ease migration. |
Thanks for the quick implementation! But where did you release your snapshot version? Can't find it on mvn central... |
Hi @aegliv, it is on maven central (https://oss.sonatype.org/#nexus-search;quick~openapiprocessor), the central snapshots repository is: https://oss.sonatype.org/content/repositories/snapshots if you are using the gradle plugin (2021.3) it should automatically find it (the plugin adds the snapshots repository), if you are using the maven plugin (2021.1) you probably need to add the repository. <pluginRepositories>
<pluginRepository>
<id>openapi-processor-snapshots</id>
<name>openapi-processor-snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</pluginRepository>
</pluginRepositories> |
released with 2021.4 |
Thanks, works like a charm! Sry I could not test it earlier but my company's firewall did not let me download your SNAPSHOT version |
Thanks, nice to hear that it works for you :-) |
Hi,
awesome project, thanks for putting in the hours!
The
openapi-generator-maven-plugin
has a configuration property calledmodelNameSuffix
which, as the name suggest, allows the user to append a suffix to the generated model classes.Do you thing such a feature would be valuable in your project as well?
Example
Swagger:
Mapping:
Would result in the generation of
example.gen.model.FooObjectDto.java
The text was updated successfully, but these errors were encountered: