Open kentbulza opened 7 months ago
hey @kentbulza while this is supported in JSON Schema, but we'll take this as an enhancement request of @stoplight/json-schema-viewer
. As a workaround, you can declare examples of the array itself.
{
"type": "object",
"properties": {
"x": {
"type": "array",
"items": {
"type": "string",
"examples": ["bar"] // Don't use this example here
},
"examples": [["foo"], ["abc"]] // Examples here
}
}
}
This ticket has been labeled jira. A tracking ticket in Stoplight's Jira (STOP-447
) has been created.
When examples are included for an array of strings, the examples do not display in the request body schema.
Context
Would like to display examples just like one gets for standard strings. Attached is an example OpenAPI 3.1.0. document demonstrating the issue. noarrayexamples.example.json
Current Behavior
Array examples do not display.
Expected Behavior
Would like to see array examples.