Reputation: 81
I have this object in java with an attribute called type, that represents an enum:
public class Patch<T> {
@JsonProperty("path")
protected String path;
@JsonProperty("op")
protected TypeValue op;
@JsonProperty("value")
protected T value;
}
This object, when generating a spec in yaml using springfox generates this output when referencing the object TypeValue:
Patch:
type: object
properties:
op:
type: string
enum:
- add
- remove
- replace
- move
- copy
path:
type: string
value:
type: object
properties: {}
title: Patch
What I want to do is to ignore the enum type when generating the doc, removing the enum type from the spec. Tis is what I want:
Patch:
type: object properties: op: type: string path: type: string value: type: object properties: {} title: Patch
I tried to use the @ApiModelProperty(dataType = "string", allowValues = "A, B, C") but the result is the same
How can I do this?
Upvotes: 0
Views: 345
Reputation: 181
Have you tried using @Hidden
?
https://docs.swagger.io/swagger-core/v2.1.1/apidocs/io/swagger/v3/oas/annotations/Hidden.html
Upvotes: 0