I'm using a swagger yaml file to define my API and generate Java code out of it. With this structure:
SomeStructure:
type: object
properties:
field1:
type: string
required: true
field2:
type: string
required: true
field3:
type: string
additionalProperties: {}
Now, once API code generation is done, I would like the 3rd field to flatten any specified JSON structure into a Java String.
For instance, for an input like this:
{
"field1":"value1",
"field2":"value2",
"field3":{
"subvalue1":"subvalue1",
"subvalue2":"subvalue2"
}
}
I want it to get mapped to a String containing:
{"subvalue1":"subvalue1","subvalue2":"subvalue2"}
I tried to use the freeform indicator '{}', but obviously, it's not working. Is it possible, and how do I do this?