-
Notifications
You must be signed in to change notification settings - Fork 12
Remove compat.jl in favor of explicitly breaking changes #72
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
base: master
Are you sure you want to change the base?
Conversation
| backwards compatibility, `SingleIssue` is aliased to `ValidationResult`, so | ||
| existing `isa` checks will continue to work. | ||
| The `SingleIssue` type from v1.x has been removed and replaced by | ||
| `ValidationResult`. |
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.
It's a bit weird to keep this only so isa works. If anyone is constructing them or trying to query field values it will break.
|
|
||
| ### 3. `diagnose` Function | ||
|
|
||
| The previously deprecated `diagnose` function has been removed. Use |
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.
Removed. This was from a long time ago.
| ### 4. Inverse Argument Order | ||
|
|
||
| The `validate` and `isvalid` functions where `schema` is the second argument | ||
| have been removed. `schema` must be the first argument. |
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.
Ditto here. There should be only one way to do things.
| ```julia | ||
| schema = Schema(Dict("type" => "object")) | ||
| schema.data["type"] # Works - maps to schema.spec | ||
| ``` |
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.
I don't think this was ever part of the public API
| ```julia | ||
| schema = Schema(Dict("type" => "object", "required" => ["foo"])) | ||
| isvalid(schema, Dict("bar" => 1)) # Returns false (v1.x behavior) | ||
| ``` |
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.
This is a weird one. The current code you added to work-around was un-tested. I've removed, we can always add it back if someone complains
| Schema(spec::AbstractVector{UInt8}) = Schema(JSON.parse(spec)) | ||
|
|
||
| # Boolean schemas are part of the draft6 specification. | ||
| function Schema(b::Bool) |
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.
This is not a compat thing. It's part of the spec:
https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/main/tests/draft6/boolean_schema.json
I'll comment in-line