I'm trying to document the following class, which is returned by a Spring-based API:
public class CytoscapeJsWrapper
{
...
@Schema ( description =
"""
As per Cytoscape.js, this contains a 'data' element, containing node properties
(eg, id, type, label, and a few others). See /graphDetails for more information.
"""
)
public JsonNode getNodes ()
{
return nodes;
}
@Schema ( description =
"""
Same as /elements/nodes, with the addition of the 'source' and 'target' properties.
"""
)
public JsonNode getEdges ()
{
return edges;
}
}
The generated OpenAPI I can see at http://localhost:8080/v3/api-docs/v1:
...
"CytoscapeJsWrapper": {
"type": "object",
"properties": {
"nodes": {
"$ref": "#/components/schemas/JsonNode"
},
"edges": {
"$ref": "#/components/schemas/JsonNode"
}
},
"description": "The graph obtained from merging all the resulting semantic motif paths..."
}
...
And only one JsonNode definition in the components section:
...
"JsonNode": {
"type": "object",
"description": "Same as /elements/nodes, with the addition of the 'source' and 'target' properties.\n"
}
...
While it should apply both the @Schema annotations and describe the two different fields properly.
I'm trying to document the following class, which is returned by a Spring-based API:
The generated OpenAPI I can see at
http://localhost:8080/v3/api-docs/v1
:And only one JsonNode definition in the
components
section:While it should apply both the
@Schema
annotations and describe the two different fields properly.