You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a yaml input document containing a snippet like the following ...
paths:
/management/api/v1/users/{userId}:
patch:
x-codegen-request-body-name: messagetags:
- Backup Management Service
- Backup Management Service Userssummary: Update the specified user detailsdescription: Update the specified user detailsoperationId: updateUserAsAdminparameters:
- name: userIdin: pathdescription: User identifier which may be extended format identifier e.g. machine:89928359235required: trueschema:
type: stringrequestBody:
description: Details of user to updatecontent:
application/json:
schema:
$ref: '#/components/schemas/rest.UserUpdateRequest'required: trueresponses:
'200':
description: OKcontent:
application/json:
schema:
$ref: '#/components/schemas/rest.UserResource''401':
$ref: '#/components/responses/401-Unauthorized''404':
$ref: '#/components/responses/404-NotFound'
the generated java output looks something like ...
/** * Update the specified user details * Update the specified user details * * @param userId User identifier which may be extended format identifier e.g. machine:89928359235 (required) * @param message Details of user to update (required) * @return RestUserResource */@ApiOperation(
value = "Update the specified user details",
nickname = "updateUserAsAdmin",
notes = "Update the specified user details",
response = RestUserResource.class,
authorizations = {
@Authorization(value = "bearerAuth")
},
tags={})
@ApiResponses(value = {
@ApiResponse(code = 200, message = "OK", response = RestUserResource.class),
@ApiResponse(code = 401, message = "Unauthorized", response = RestError.class),
@ApiResponse(code = 404, message = "Not Found", response = RestError.class)})
@Patch(uri="/management/api/v1/users/{userId}")
@Produces(value = {"application/json"})
@Consumes(value = {"application/json"})
publicMono<RestUserResource> updateUserAsAdminApi(
@PathVariable(value="userId") @NotNullStringuserId,
@Body@NotNull@ValidRestUserUpdateRequestmessage
) {
returnupdateUserAsAdmin(userId, message);
}
It would be nice if there were a mechanism to exclude the generation of the ApiOperation and ApiResponses annotation output in the java. They yaml document is already the source of truth, duplicating the output in Java whilst nice also makes for massive Java files. In our case, we won't be generating from Java back to Yaml and have no need for those annotations to appear in the source.
The text was updated successfully, but these errors were encountered:
mshannongit
changed the title
[Micronaut server] Add ability to exclude ApiOperation and ApiResponses annotation output from generated methods
[Micronaut server] Add ability to exclude Swagger ApiOperation and ApiResponses annotation output from generated methods
Apr 24, 2022
Leveraging release 5.4 ...
Given a yaml input document containing a snippet like the following ...
the generated java output looks something like ...
It would be nice if there were a mechanism to exclude the generation of the ApiOperation and ApiResponses annotation output in the java. They yaml document is already the source of truth, duplicating the output in Java whilst nice also makes for massive Java files. In our case, we won't be generating from Java back to Yaml and have no need for those annotations to appear in the source.
The text was updated successfully, but these errors were encountered: