restdocs-api-spec
restdocs-api-spec copied to clipboard
Subschema examples
I'd like to use the new subschema feature, but can't seem to get it to work.
Adding the attribute to the sub model like so:
fieldWithPath("recipes[]").optional().attributes(schema("RecipeData"))
.description("List of recipes."),
generates a resource.json:
...
{
"attributes" : {
"schemaName" : "RecipeData"
},
"description" : "List of recipes.",
"ignored" : false,
"path" : "data.recipes[]",
"type" : "ARRAY",
"optional" : true
},
...
But openapi.json doesn't seem to get affected at all. How to use the newly released feature?
Yeah, when the object field like so List<Object>... the schemaName is not available? I don't know, how to resolve it.