restdocs-spec
restdocs-spec copied to clipboard
SubSchema not working
I'm trying to use the new SubSchema attribute which was introduced in latest restdocs-api-spec https://github.com/ePages-de/restdocs-api-spec/pull/246
But when using it, I get an exception:
Attribute example:
fieldWithPath("data").attributes(Attributes.key("schemaName").value("cookbookTest123")).description("Cookbook")
Exception:
[ERROR] Unrecognized field "items" (class io.swagger.v3.oas.models.media.Schema), not marked as ignorable (33 known properties: "default", "multipleOf", "minimum", "exclusiveMinimum", "not", "extensions", "xml", "title", "discriminator", "required", "maximum", "nullable", "exclusiveMaximum", "minProperties", "externalDocs", "maxLength", "writeOnly", "uniqueItems", "properties", "maxProperties", "type", "maxItems", "enum", "minItems", "pattern", "minLength", "readOnly", "example", "$ref", "deprecated", "format", "additionalProperties", "description"])
[ERROR] at [Source: (String)"{"title":"cookbookTest123","multipleOf":null,"maximum":null,"exclusiveMaximum":null,"minimum":null,"exclusiveMinimum":null,"maxLength":null,"minLength":null,"pattern":null,"maxItems":null,"minItems":null,"uniqueItems":null,"maxProperties":null,"minProperties":null,"required":["id","recipeCount","title"],"type":"object","not":null,"properties":{"recipes":{"title":null,"multipleOf":null,"maximum":null,"exclusiveMaximum":null,"minimum":null,"exclusiveMinimum":null,"maxLength":null,"minLength":null,"[truncated 4259 chars]; line: 1, column: 917] (through reference chain: io.swagger.v3.oas.models.media.ObjectSchema["properties"]->java.util.LinkedHashMap["recipes"]->io.swagger.v3.oas.models.media.Schema["items"])
Versions in use:
<restdocs-api-spec.version>0.19.0</restdocs-api-spec.version>
<restdocs-spec.version>0.23</restdocs-spec.version>