@@ -7,7 +7,7 @@ A collection of modules for working with JSON Schemas.
77 * Schemas can reference other schemas using a different dialect
88 * Work directly with schemas on the filesystem or HTTP
99* OpenAPI
10- * Versions: 3.0, 3.1
10+ * Versions: 3.0, 3.1, 3.2
1111 * Validate an OpenAPI document
1212 * Validate values against a schema from an OpenAPI document
1313* Create custom keywords, vocabularies, and dialects
@@ -132,22 +132,22 @@ system](https://github.com/hyperjump-io/browser/#uri-schemes) provided by
132132
133133** OpenAPI**
134134
135- The OpenAPI 3.0 and 3.1 meta-schemas are pre-loaded and the OpenAPI JSON Schema
135+ The OpenAPI 3.0 and 3.1 and 3.2 meta-schemas are pre-loaded and the OpenAPI JSON Schema
136136dialects for each of those versions is supported. A document with a Content-Type
137137of ` application/openapi+json ` (web) or a file extension of ` openapi.json `
138138(filesystem) is understood as an OpenAPI document.
139139
140140Use the pattern ` @hyperjump/json-schema/* ` to import the version you need. The
141- available versions are ` openapi-3-0 ` for 3.0 and ` openapi-3-1 ` for 3.1.
141+ available versions are ` openapi-3-0 ` for 3.0, ` openapi-3-1 ` for 3.1, and ` openapi-3-2 ` for 3.2 .
142142
143143``` javascript
144- import { validate } from " @hyperjump/json-schema/openapi-3-1 " ;
144+ import { validate } from " @hyperjump/json-schema/openapi-3-2 " ;
145145
146146
147- // Validate an OpenAPI document
148- const output = await validate (" https://spec.openapis.org/oas/3.1 /schema-base" , openapi);
147+ // Validate an OpenAPI 3.2 document
148+ const output = await validate (" https://spec.openapis.org/oas/3.2 /schema-base" , openapi);
149149
150- // Validate an instance against a schema in an OpenAPI document
150+ // Validate an instance against a schema in an OpenAPI 3.2 document
151151const output = await validate (" ./example.openapi.json#/components/schemas/foo" , 42 );
152152```
153153
@@ -156,6 +156,19 @@ YAML support isn't built in, but you can add it by writing a
156156use the one at ` lib/openapi.js ` as an example and replace the JSON parts with
157157YAML.
158158
159+ <!-- ## `package.json` Exports -->
160+ <!-- ```json
161+ "exports": {
162+ "./openapi-3-0": "./openapi-3-0/index.js",
163+ "./openapi-3-1": "./openapi-3-1/index.js",
164+ "./openapi-3-2": "./openapi-3-2/index.js"
165+ } -->
166+
167+ ** ` package.json ` exports** — add:
168+
169+ ``` json
170+ "./openapi-3-2" : " ./openapi-3-2/index.js"
171+
159172**Media types**
160173
161174This library uses media types to determine how to parse a retrieved document. It
0 commit comments