swagger-codegen-generators
swagger-codegen-generators copied to clipboard
[SPRING] OAuth2 scopes missing
- when setting security scopes in api definition they should be in the generated code too
@ApiOperation(value = "Get Data", nickname = "getData", notes = "", response = Data.class, authorizations = {
@Authorization(value = "oAuth", scopes = {
<the scopes list should be inserted here>
})
}, tags={ "data", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "data", response = Data.class),
@ApiResponse(code = 200, message = "unexpected error", response = Error.class) })
@RequestMapping(value = "/data",
produces = { "application/json" },
method = RequestMethod.GET)
ResponseEntity<Data> getData();
my api definition looks like:
/data:
get:
summary: Get Data
operationId: getData
tags:
- data
responses:
'200':
description: data
content:
application/json:
schema:
$ref: "#/components/schemas/Data"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
security:
- oAuth: ["data:read"]
components:
securitySchemes:
oAuth:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://example.com/oauth/authorize
tokenUrl: https://example.com/oauth/token
scopes:
- data:read
Hi,
Is there any progress on this?
Thank you!