-
-
Notifications
You must be signed in to change notification settings - Fork 223
Closed
Labels
bugA test is wrong, or tooling is broken or buggy.A test is wrong, or tooling is broken or buggy.
Description
I'm not sure that the contentSchema
are fully testing what they intend to.
For example:
- file: content.json (any draft)
- case: validation of binary-encoded media type documents with schema
- test: a valid base64-encoded JSON document
- expected: valid
Schema:
{
"$schema": "https://json-schema.org/draft/next/schema",
"contentMediaType": "application/json",
"contentEncoding": "base64",
"contentSchema": {
"required": [
"foo"
],
"properties": {
"foo": {
"type": "string"
}
}
}
}
Instance
"eyJmb28iOiAiYmFyIn0K"
(instance decodes to {"foo": "bar"}
)
The subschema at /contentSchema
(based on the keywords present) seems to be expecting an object. However, if an implementation ignores the encoding and media type and just validates this as a string, the test incorrectly passes. (Mine does this.)
I suggest we need to add a "type": "object"
restriction to the subschema to ensure that it requires an object and doesn't just validate the base64 string.
Metadata
Metadata
Assignees
Labels
bugA test is wrong, or tooling is broken or buggy.A test is wrong, or tooling is broken or buggy.