OpenApi and JSON Schema
Table of Contents
1. TODOs
- OpenApi
- Model
- Schema objects
- XML objects
- https://github.com/openapi-contrib/openapi-schema-to-json-schema
- https://github.com/openapi-contrib/json-schema-to-openapi-schema
- npm package
swagger-cli
- can be used to merge (bundle) a bunch of openapi specs
2. OpenApi
Data types
in OpenApi are based on thetypes
in JSON Schema- JSON Schema vs OAS' "schema" https://swagger.io/docs/specification/data-models/keywords/
- Web Services Description Language (WSDL)
3. JSON Schema
- Regexes in JSON Schema are ECMA-262 (a.k.a. ECMAScript a.k.a. JavaScript) regular expression
- Date and time format names are derived from RFC 3339, section 5.6.
- IIUC, this is ISO 8601
- Duration format is from the ISO 8601 ABNF as given in Appendix A of RFC 3339.
- There are 5 categories of
keywords
- identifiers
- assertions
- annotations
- applicators
- reserved locations
3.1. Formats
- date-time
- date
- time
- duration
- idn-email
- hostname
- ipv4
- ipv6
- uri
- uri-reference
- iri
- iri-reference
- uuid
- uri-template
- json-pointer
- relative-json-pointer
- regex
4. The official specifications
5. Versions
As of 2024-06-07,
- the latest version of JSON Schema Specification is 2020-12
- the latest version of OpenApi Specification is 3.1.0