In our project, we generate controllers with OpenAPI generator. In one of those controllers, there's an endpoint with a path variable, on which I need to put our custom annotation @Encrypted
, like below:
@RequestMapping(
method = RequestMethod.GET,
value = "/notification/{id}/download",
produces = { "application/pdf", "application/json" }
)
ResponseEntity<.springframework.core.io.Resource> downloadNotification(
@Size(max = 255) @PathVariable("id") @Encrypted String id
);
and this is specification. I tried x-field-extra-annotation
:
/notification/{id}/download:
get:
parameters:
- name: id
schema:
maxLength: 255
type: string
in: path
required: true
x-field-extra-annotation: "@sbbol.annotation.Encrypted"
However, OpenAPI ignores it, and I get an endpoint without my annotation:
ResponseEntity<.springframework.core.io.Resource> downloadNotification(
@Size(max = 255) @PathVariable("id") String id
);
Is there a way to put a custom annotation on a path variable in OpenAPI?