openapi-codegen | OpenAPI 30 CodeGen plus Nodejs minus the Java and emojis | REST library
kandi X-RAY | openapi-codegen Summary
kandi X-RAY | openapi-codegen Summary
OpenAPI 3.0 CodeGen plus Node.js minus the Java and emojis
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Convert an op to a REST operation .
- Transform api .
- Prime API builder .
- Converts a Swagger API definition to a specifications file .
- convert source paths to default values
- Get base info .
- Get authentication data
- Convert an api to apis .
- Select the URL
- Generate a zip file .
openapi-codegen Key Features
openapi-codegen Examples and Code Snippets
Community Discussions
Trending Discussions on openapi-codegen
QUESTION
I have a maven project with my API definition using the OpenaAPI v3 specification.
I generate the code using the openapi-generator-maven-plugin and all works fine. I'm also able to access the swagger-ui and view and test my API.
The problem is that I don't want to maintain the version number twice. So I'd like to refer the version number from my maven pom in my api spec instead of duplicating it with the risk of it getting outdated.
I've tried maven resource filtering, which seems to work. Since the yaml file in the target folder gets it nicely replaced when I put ${project.version}
in the version field in the spec, but when I open the swagger-ui it prints "${project.version}" literally instead of the actual version.
This is the plugin config from my pom:
...ANSWER
Answered 2019-Sep-11 at 07:25Thanks to the comment from @bcoughlan I was able to get the maven-resources-plugin working as desired.
Now it takes filters the *yml file from the src/main/resources folder and replaces the ${project.version} placeholder during the generates-sources
phase. Because the openapi-generator-maven-plugin executes in the same phase and is defined later, it will be executed after the resource filtering and will operate on the api spec in the target folder as a result of ${project.build.outputDirectory}/spec.yml
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install openapi-codegen
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page