Support @Schema(hidden = true) on @Parameter
See original GitHub issueIt would be nice to just set @Parameter(schema = @Schema(hidden = true))
to hide the Schema
objects entirely.
Currently, the following still results in schema generation:
@PostMapping("/examplePost")
@Operation(summary = "schema example")
public Object example(@Parameter(schema = @Schema(hidden = true)) JsonNode json)) {
}
@GetMapping("/example")
public void test(@Parameter(schema = @Schema(hidden = true) JsonNode json) {
}
Results in:
"/example": {
"post": {
"requestBody":{
"content":{
"*/*":{
"schema":{
"$ref":"#/components/schemas/JsonNode"
}
}
},
"required":false
}
}
}
....
"JsonNode":{
"type":"object",
"properties":{
"float":{
"type":"boolean"
},
"array":{
"type":"boolean"
},
"null":{
"type":"boolean"
},
"number":{
"type":"boolean"
},
"floatingPointNumber":{
"type":"boolean"
},
"containerNode":{
"type":"boolean"
},
"missingNode":{
"type":"boolean"
},
"object":{
"type":"boolean"
},
"nodeType":{
"type":"string",
"enum":[
"ARRAY",
"BINARY",
"BOOLEAN",
"MISSING",
"NULL",
"NUMBER",
"OBJECT",
"POJO",
"STRING"
]
},
"pojo":{
"type":"boolean"
},
"integralNumber":{
"type":"boolean"
},
"short":{
"type":"boolean"
},
"int":{
"type":"boolean"
},
"long":{
"type":"boolean"
},
"double":{
"type":"boolean"
},
"bigDecimal":{
"type":"boolean"
},
"bigInteger":{
"type":"boolean"
},
"textual":{
"type":"boolean"
},
"boolean":{
"type":"boolean"
},
"binary":{
"type":"boolean"
},
"valueNode":{
"type":"boolean"
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:9
Top Results From Across the Web
Hidden parameter in springdoc-openapi doesn't work
I have annotated parameter in operation like this. parameters = { @Parameter( hidden = true, schema = @Schema(implementation = Boolean.class), ...
Read more >Describing Parameters - Swagger
Query parameters only support primitive types. You can have an array ... Also, remember to add required: true , because path parameters are...
Read more >Hide a Request Field in Swagger API - Baeldung
A quick and practical guide to hiding a request field in Swagger UI.
Read more >F.A.Q - Springdoc-openapi
To enable the support of multiple OpenAPI definitions, a bean of type GroupedOpenApi ... A solution workaround would be to use: @Parameter(hidden =...
Read more >Guide - 7.10.12.2 Migrating to OpenApi 3.0 and Swagger 2.X ...
@APIModelProperty(readOnly = true), @Schema(accessMode=AccessMode.READ_ONLY) ... @Override public Response get(@Parameter(description = "The external id") ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
The fix will be available on v1.2.7, of springdoc-openapi.
Sorry, I forgot to update the GET endpoint. Here is the example I’d expect by applying
@Parameter(schema = @Schema(hidden = true)
to the method parameters: