-
Notifications
You must be signed in to change notification settings - Fork 9.1k
v3.2: Guidance on searching and evaluating schemas #4743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
handrews
wants to merge
5
commits into
OAI:v3.2-dev
Choose a base branch
from
handrews:schema-search
base: v3.2-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4c3c8b1
Guidance on searching and evaluating schemas
handrews a3db2bb
Rework schema searching guidance
handrews 0912400
Fix spelling
handrews 6290e79
Punt on most multi-valued types
handrews fa12074
Fix incorrect bit about binary and schemas
handrews File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"format": "binary"
would be an ideal signal for this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not a format in 3.1+. the appropriate signal would be
"contentMediaType": "application/octet-stream"
or similar. But because of how the Encoding Object works, it's all more complicated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many other binary media types, e.g.
image/jpeg
, where it's not useful to apply a schema to the content and we might want to use a placeholder.I'm now wondering if we need a signal for "do not bother trying to deserialize this content for the purpose of validation". At present my implementation always applies the appropriate media type deserialization to the content and applies the schema to it (and throws an error if it doesn't know how to process that media type, or if the deserializer encountered an error), but bypassing that might be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karenetheridge I meant "some binary media type in
contentMediaType
" more than specificallyapplication/octet-stream
, but arguably tacking "or similar" on as I did was not sufficiently clear!I'm open to better ideas here. Perhaps it is best to remove the placeholder idea as it is pretty squishy and can easily cause problems, and just document the schema search (and break apart) process, which leverages things implementations have to do anyway. We could include a brief note about the possibilities and dangers of using a placeholder instead? idk.
I'm not entirely sure what to do with this. I sort-of follow you, but I would not be surprised if you have the only JSON Schema implementation that can handle this at all, and I want to write the requirements for the typical case.