restdocs-api-spec icon indicating copy to clipboard operation
restdocs-api-spec copied to clipboard

Subschema examples

Open heyarny opened this issue 2 years ago • 1 comments

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?

heyarny avatar Oct 11 '23 11:10 heyarny

Yeah, when the object field like so List<Object>... the schemaName is not available? I don't know, how to resolve it.

better789 avatar Dec 23 '24 08:12 better789