-
What a title. I noticed today that we are sending data in our responses that is not described in the component spec. In the example schema I'll post below I have a
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Your example is valid and is equivalent to this (YAML version for readability): Object:
required: [id, title, created_at]
type: object
properties:
id:
type: integer
title:
description: Title for the new object.
type: string
created_at: {} # The value can be of any type Extra properties not explicitly defined under You can use a linter to enforce that the properties listed in the |
Beta Was this translation helpful? Give feedback.
-
This JSON Schema question was answered, closing. |
Beta Was this translation helpful? Give feedback.
Your example is valid and is equivalent to this (YAML version for readability):
Extra properties not explicitly defined under
properties
are allowed unless the schema hasadditionalProperties: false
/unevaluatedProperties: false
.You can use a linter to enforce that the properties listed in the
required
list are explicitly defined inproperties
.