Open davidkarlsen opened 5 years ago
I've updated the title as this isn't a Maven plugin concern but a concern of the specific generator.
I think this is a feature request rather than a bug. There's no expectation that generated code matches the OpenAPI spec version, but it sounds like this is the assumption being made. I don't disagree, I just wanted to clarify. I think it would make sense that if you're generating a server implementation from a 3.x version spec document, that you're implying you'd like a 3.x implementation generated.
I don't think the parser exposes the spec version to us, so making this work automatically might require a little finesse. It might make sense to add support for the 3.x annotations and default to those, with a fallback option to the 2.0 annotations. I'm not familiar with this specific generator, so I'll defer to the technical committee for Java.
So if we update the mustache templates does it work as expected relates to https://github.com/OpenAPITools/openapi-generator/pull/5556
We are generating our spring controllers based on openapi definitions (3.0.0). I would also expect, that the annotations used are from io.swagger.v3.oas
. Without the change, a switch to springdoc is not possible, due to missing tags and security annotations.
We are generating our spring controllers based on openapi definitions (3.0.0). I would also expect, that the annotations used are from
io.swagger.v3.oas
. Without the change, a switch to springdoc is not possible, due to missing tags and security annotations.
But the original query was when we are using jaxrs-cxf not spring-mvc or webflux implementation.
Bug Report Checklist
Description
Generating code with
<generatorName>jaxrs-cxf-extended</generatorName>
or<generatorName>jaxrs-cxf</generatorName>
create invalid imports:io.swagger.annotations
, as the speclevel of my api is3.0.0
it should useio.swagger.v3.oas.annotations
openapi-generator version
4.1.0
OpenAPI declaration file content or url
Cannot disclose
Command line used for generation
Steps to reproduce
Configure plugin as described, feeding it a speclevel 3 api description
Related issues/PRs
Suggest a fix
use the updated package path in the templates