Closed
Description
Context
I have a filter that adds attributes to the HTTP requests that are derived from headers and other things. In my controllers, I have endpoints that uses these attributes, like this:
@GetMapping("/{id}")
fun getById(
@PathVariable(value = "id") id: Long,
@RequestAttribute(value = "userid") userId: Int, /* <= set in a filter */
@RequestParam(name = "writable", required = false) writable: Boolean = false
) { /* ... */ }
The generated UI is:
Problem
I expect the @RequestAttribute
to be ignored by OpenAPI, since it is an internal attribute that the client ignores. But it is still present in the interface (which is misleading) and marked as required (so the user cannot use try it out).
Questions
- Is this a normal behavior ?
- How can I mark a method parameter as hidden (and if possible globally, since the same attribute is used in many places) ?
versions
org.springframework.boot
=> 2.2.1.RELEASEorg.springdoc:springdoc-openapi-ui
=> 1.2.17