Support for JsonAnySetter/AnyGetter wrapper classes
If you have a wrapping class for a Map<String, Any>, there is no model converter to correct the object. If you had a List<MyWrappingObject>, the swagger produced is
{
"objects": [
{
"myObjects": { }
}
]
}
where myObjects is the field in MyWrappingObject with @JsonAnySetter and @get:JsonAnyGetter
@croudet any suggestions on best way to deal with this? The best i could think of at the moment is to use a custom Schema on the parent property that uses this pojo, but the micronaut-opeapi generation does not override the pojo impl schema.
I think the "solution" for this is to recommend applying the @field:Hidden annotation on the single property such as:
@Schema(name = "some-object", description = "Some Object", type = "object")
data class SomeObject(
@JsonAnySetter
@get:JsonAnyGetter
@field:Hidden
val someObject: Map<String, Any> = mutableMapOf()
)
which will generate a schema of:
some-object:
type: object
description: Some Object