Closed LinghaoYu closed 3 years ago
We have a model defined as
@Schema(name = "MapResource", description = "A single map resource", requiredProperties = {}) public class MapResource extends HashMap<String, List<MapResourceEntry>> { public MapResource() { // Empty MapResource constructor } }
In the generated openapi spec file, it becomes
components: schemas: MapResource: type: object properties: empty: type: boolean description: A single map resource additionalProperties: type: array items: $ref: '#/components/schemas/MapResource.MapResourceEntry'
How to get rid of this empty property? Swagger core has the same issue https://github.com/swagger-api/swagger-core/issues/3535# but their workaround cannot be applied to microprofile.
@LinghaoYu - see if adding this field to your class works:
@Schema(hidden = true) boolean empty;
Hi @MikeEdgar Thanks, it worked!
We have a model defined as
In the generated openapi spec file, it becomes
How to get rid of this empty property? Swagger core has the same issue https://github.com/swagger-api/swagger-core/issues/3535# but their workaround cannot be applied to microprofile.