Open nbreuil opened 6 months ago
SecurityRequirements are not generated on API operation with JAX-RS / Jersey 3
My generated file :
@jakarta.ws.rs.GET @Operation(summary = "test jersey3", description = "", responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Void.class))), }, tags={ }) public Response petGet(@Context SecurityContext securityContext) throws NotFoundException { return delegate.petGet(securityContext); }
File I expect :
@jakarta.ws.rs.GET @Operation(summary = "test jersey3", description = "", responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Void.class))), }, security = { @SecurityRequirement(name = "api_key") }, tags={ }) public Response petGet(@Context SecurityContext securityContext) throws NotFoundException { return delegate.petGet(securityContext); }
7.2.0 & master
openapi: 3.0.3 info: title: Jersey 3 security example version: 1.0.0 paths: /pet: get: summary: test jersey3 responses: '200': description: successful operation security: - api_key: [] components: securitySchemes: api_key: type: apiKey name: api_key in: header
<generatorName>jaxrs-jersey</generatorName> <library>jersey3</library>
or
java -jar openapi-generator-cli-7.2.0.jar generate -g jaxrs-jersey -i api.yaml --library jersey3
Generate sources
None
This file might be concerned, it doesn't include security parameters : api.mustache
PR here : #17778
Bug Report Checklist
Description
SecurityRequirements are not generated on API operation with JAX-RS / Jersey 3
My generated file :
File I expect :
openapi-generator version
7.2.0 & master
OpenAPI declaration file content or url
Generation Details
or
Steps to reproduce
Generate sources
Related issues/PRs
None
Suggest a fix
This file might be concerned, it doesn't include security parameters : api.mustache