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
Swagger schema validation failed.
Data does not match any schemas from 'oneOf' at #/paths//system/properties/{key}/get/responses/200
Additional properties not allowed: example at #/paths//system/properties/{key}/get/responses/200
Missing required property: $ref at #/paths//system/properties/{key}/get/responses/200
Look into the swagger file, /system/properties/{key}/get will return a response of the union of gps and aliasName. However, the error told us data does not match any schema from oneOf.
According to swagger document, to validate an union payload from multi schemas, we should use allOf in definition of schemas where an example shown as below
components:
schemas:
Pet:
type: object
required:
- pet_type
properties:
pet_type:
type: string
discriminator:
propertyName: pet_type
Dog: # "Dog" is a value for the pet_type property (the discriminator value)
allOf: # Combines the main `Pet` schema with `Dog`-specific properties
- $ref: '#/components/schemas/Pet'
- type: object
# all other properties specific to a `Dog`
properties:
bark:
type: boolean
breed:
type: string
enum: [Dingo, Husky, Retriever, Shepherd]
Cat: # "Cat" is a value for the pet_type property (the discriminator value)
allOf: # Combines the main `Pet` schema with `Cat`-specific properties
- $ref: '#/components/schemas/Pet'
- type: object
# all other properties specific to a `Cat`
properties:
hunts:
type: boolean
age:
type: integer
Got error message from #33 travis log
Look into the swagger file,
/system/properties/{key}/get
will return a response of the union ofgps
andaliasName
. However, the error told us data does not match any schema fromoneOf
.According to swagger document, to validate an union payload from multi schemas, we should use
allOf
in definition of schemas where an example shown as belowbut in
oapi-tp-gateway/schema/system/index.yaml
.The text was updated successfully, but these errors were encountered: