You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Am running v0.12.0 installed inside a Node 12.4 Docker container.
Given the following openapi v3 spec:
openapi: 3.0.0
info:
description: Test arrays returned
version: '0'
title: Things service
servers:
- url: 'https://example.com/test'
paths:
'/things':
post:
summary: Do things
operationId: do_things
responses:
'200':
description: OK.
content:
application/json:
schema:
$ref: '#/components/schemas/ThingsArray'
components:
schemas:
ThingsArray:
description: List of empty Things
type: array
items:
type: object
This defines the response of POST /things to be an array of empty objects.
Current behaviour
The file above passes the validator with all operations post, put, patch, delete, head, options, and trace - it only fails when 'get' is used.
It also passes when imaginary operations are used: look, shut, open.
Expected behaviour
The file above should fail with:
errors
Message : Arrays MUST NOT be returned as the top-level structure in a response body.
Path : paths./things.post.responses.200.content.application/json.schema
Line : 18
statistics
Total number of errors : 1
Total number of warnings : 0
errors
1 (100%) : Arrays MUST NOT be returned as the top-level structure in a response body.
This should also happen for all other operations - real or created.
The text was updated successfully, but these errors were encountered:
Am running v0.12.0 installed inside a Node 12.4 Docker container.
Given the following openapi v3 spec:
This defines the response of
POST /things
to be an array of empty objects.Current behaviour
The file above passes the validator with all operations post, put, patch, delete, head, options, and trace - it only fails when 'get' is used.
It also passes when imaginary operations are used: look, shut, open.
Expected behaviour
The file above should fail with:
This should also happen for all other operations - real or created.
The text was updated successfully, but these errors were encountered: