What is the meaning of a Media Type Object with no schema defined? #2874
-
The spec for a Media Type Object does not say that the "schema" property is required. Therefore, it is valid to leave the schema undefined. But what does this mean? That any kind of content data is acceptable? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Not exactly. When you define the media type, you're telling the user what is expected to go over the wire. The At the moment, we only support JSON Schema for the Schema Object, meaning you can only describe JSON payloads (and to some limited extent XMLs). Had we supported things like XSD (which we may in the future), that would allow you to define schemas (or something similar) for additional media types. |
Beta Was this translation helpful? Give feedback.
-
Answerd and accepted, closing. |
Beta Was this translation helpful? Give feedback.
Not exactly. When you define the media type, you're telling the user what is expected to go over the wire. The
schema
is there to help validate the actual content. However, in many cases, a schema doesn't make sense - PDFs, audio files, binary files and so on, so specifying the schema is pointless.At the moment, we only support JSON Schema for the Schema Object, meaning you can only describe JSON payloads (and to some limited extent XMLs). Had we supported things like XSD (which we may in the future), that would allow you to define schemas (or something similar) for additional media types.