@hyperjump/json-schema 0.22.0 → 0.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -101,10 +101,14 @@ MediaTypePlugin to support that.
101
101
  way JSON is supported.
102
102
  * **MediaTypePlugin**: object
103
103
 
104
- * parse: (response: Response) => string -- Given a fetch Response object,
105
- parse the body of the request
106
- * matcher: (path) => boolean -- Given a filesystem path, return whether or
107
- not the file should be considered a member of this media type
104
+ * parse: (response: Response, mediaTypeParameters: object) => [SchemaObject, string]
105
+
106
+ Given a fetch Response object, parse the body of the request. Return the
107
+ parsed schema and an optional default dialectId.
108
+ * matcher: (path) => boolean
109
+
110
+ Given a filesystem path, return whether or not the file should be
111
+ considered a member of this media type.
108
112
 
109
113
  ```javascript
110
114
  const JsonSchema = require("@hyperjump/json-schema");
@@ -113,7 +117,7 @@ const YAML = require("yaml");
113
117
 
114
118
  // Add support for JSON Schemas written in YAML
115
119
  JsonSchema.addMediaTypePlugin("application/schema+yaml", {
116
- parse: async (response) => YAML.parse(await response.text()),
120
+ parse: async (response) => [YAML.parse(await response.text()), undefined],
117
121
  matcher: (path) => path.endsWith(".schema.yaml")
118
122
  });
119
123