When reading the specification, I get the impression that the “default” facet is valid for any type.
However, in practice when I try to render it to html using
raml2html, such defaults are lost. I also checked the output of
raml2obj, and already there they are not present, so it is not just a nunjucks template problem. Should this work? Is this according to spec?
Here is an example to show that I mean (see the
#%RAML 1.0 title: example description: Example as a Service version: v1 protocols: [HTTP] baseUri: http://example.com mediaType: application/json types: my-obj: type: object properties: list-of-strings: type: array items: string default: ["element 1", "element 2"] sub-object: type: object properties: prop-1: string prop-2: integer default: prop-1: "how to write a default?" prop-2: 42 /api/example/v1: get: responses: 200: body: application/json: type: my-obj