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
For all swagger files which have type mentioned as object and items is also present under the schema, the requests like these are being read as array which is wrong.
For example:
swagger: '2.0'
info:
description: 'This is a TEST.'
version: 1.0.0
title: Test
host: www.abc.com
basePath: /api
schemes:
- http
paths:
/test:
get:
summary: Test
description: 'test'
operationId: test
responses:
'200':
schema:
type: 'object'
items:
$ref: '#/definitions/myResponse'
description: myResponse
definitions:
myResponse:
type: object
properties:
id:
type: integer
format: `int64'
Here, under schema details since we are passing items as a non-null object which has some value, it is treating it as a array object. But, if you look above that, you'll notice that we have defined the type for this, i.e., object. So, this is wrong. It should treat this also as an object instead of array.
This change was made as a part of the following issue: #4109
This can be solved by checking if it contains a type or not. If it doesn't contain a type and items is present, then we can treat it as an array by default. But, if it contains type, then we should use that type instead of treating it as an array.
Can you please correct this?
The text was updated successfully, but these errors were encountered:
For all swagger files which have type mentioned as object and items is also present under the schema, the requests like these are being read as array which is wrong.
For example:
Here, under schema details since we are passing items as a non-null object which has some value, it is treating it as a array object. But, if you look above that, you'll notice that we have defined the type for this, i.e., object. So, this is wrong. It should treat this also as an object instead of array.
This change was made as a part of the following issue:
#4109
This can be solved by checking if it contains a type or not. If it doesn't contain a type and items is present, then we can treat it as an array by default. But, if it contains type, then we should use that type instead of treating it as an array.
Can you please correct this?
The text was updated successfully, but these errors were encountered: