-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for application/octet-stream (#527)
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Solutions/Corvus.Json.Specs/Features/AdditionalSchema/Draft202012/Repro526.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@draft202012 | ||
|
||
Feature: Repro 526 draft202012 | ||
|
||
Scenario Outline: Base64 encoded application/octet-stream. | ||
Given a schema file | ||
""" | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"file": { | ||
"type": "object", | ||
"properties": { | ||
"content": { | ||
"type": "string", | ||
"contentEncoding": "base64", | ||
"contentMediaType": "application/octet-stream" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
""" | ||
And the input data value <inputData> | ||
And I assert format | ||
And I generate a type for the schema | ||
And I construct an instance of the schema type from the data | ||
When I validate the instance | ||
Then the result will be <valid> | ||
|
||
Examples: | ||
| inputData | valid | | ||
| { "file": { "content": "eyJmb28iOiAiYmFyIn0K" } } | true | | ||
# Invalid items validate successfully even when asserted, and fail during content decoding checks. | ||
| { "file": { "content": "eyJib28iOiAyMH0=" } } | true | |