fix: required properties (#7206)
* fix: required properties schema required properties should not be treated like required: true. this lead to objects that requires properties being treated as required itself * test: try-it-out-schema-required-override-allowed Co-authored-by: Tim Lai <timothy.lai@gmail.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
swagger: '2.0'
|
||||
info:
|
||||
version: '1.0'
|
||||
title: "schema required properties should not be treated like required: true"
|
||||
paths:
|
||||
'/v1/any-path':
|
||||
put:
|
||||
summary: lorem
|
||||
operationId: setDeliveryLocation
|
||||
produces:
|
||||
- application/json
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: ipsum
|
||||
required: false
|
||||
schema:
|
||||
$ref: '#/definitions/TopModel'
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
definitions:
|
||||
TopModel:
|
||||
type: object
|
||||
properties:
|
||||
testProperty:
|
||||
$ref: '#/definitions/NestedModel'
|
||||
NestedModel:
|
||||
type: object
|
||||
required:
|
||||
- validated
|
||||
properties:
|
||||
validated:
|
||||
type: boolean
|
||||
Reference in New Issue
Block a user