Schema without type array is ignoring items in Responses
See original GitHub issueHi Team,
Please find below the swagger content in which for a response of the operation, the schema is set as items but without type array. The parser doesn’t throw any error here but the response model that is generated has ignored the items. Please correct this.
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:
items:
$ref: '#/definitions/myResponse'
description: myResponse
definitions:
myResponse:
type: object
properties:
id:
type: integer
format: `int64'
Thanks, Sree
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Json schema for array of objects doesn't validate
I think the schema is validated against the array and the objects in the array are not validated. ... Its very unclear what...
Read more >Schema validation ignoring array sub-fields type - Help
I mocked out the response body from the question and this seems to be working (failing the test due to the wrong data...
Read more >array — Understanding JSON Schema 2020-12 documentation
It works the same as items , only the name has changed. In Draft 6 - 2019-09, the additionalItems keyword is ignored if...
Read more >Array schema in a response has no maximum number of items ...
Description. An array schema does not specify the maximum number of items it can contain. For more details, see the OpenAPI Specification.
Read more >Schema does not enforce requirement of array items object
Upstream Swagger schema allows array properties without items property ... a numeric type, the effect is that the minLength is just ignored.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you @gracekarina i’ll give it a try and let you know. Thanks for the quick turnaround on the issue. Much appreciated!! Cheers
Hi @SCSreekanth parser was release last week, this fix is include in the last version 1.0.57 Swagger-parser 1.0.57 released!