How can frontend applications best work with Open API specifications?
JSON Schema is a declarative language for defining structures and constraints for JSON data. JSON Schema is a media type (application/schema+json) for defining the structure of JSON data.
A JSON Schema is a JSON document with a special media type (application/schema+json) used to describe an instance that is applied to an JSON document "instance" of media type (application/json).
JSON Schema for Open API https://spec.openapis.org/oas/3.0/schema/2024-10-18.html
Media Types
A media type (MIME type) indicates the nature and format of a document, file, or assortment of bytes.
Definition and standard: https://datatracker.ietf.org/doc/html/rfc6838
Up-to-date and complete list at IANA https://www.iana.org/assignments/media-types/media-types.xhtml
Structure
type/subtype;parameter=value
Where they're used:
- HTTP Content-Type headers (tells browsers how to handle responses)
- HTML and <script> tags (type attribute)
- File uploads (indicates what kind of file is being sent)
- Email attachments (originally designed for email, hence "Mail Extensions")
JSON
JSON stands for JavaScript Object Notation and it is a simple data interchange format.
Standard https://www.rfc-editor.org/rfc/pdfrfc/rfc8259.txt.pdf
JSON is built on the following data structures:
object
{ "key1": "value1", "key2": "value2" }arrays
[ "first", "second", "third" ]number
42
3.1415926string
"This is a string"boolean
true
falsenull
nullAll types of structured data can be represented with these simple data types.