Skip to content
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

Union of string and bytes should be bytes #83

Open
acmiyaguchi opened this issue Aug 5, 2019 · 0 comments
Open

Union of string and bytes should be bytes #83

acmiyaguchi opened this issue Aug 5, 2019 · 0 comments

Comments

@acmiyaguchi
Copy link
Contributor

(Type::Atom(left), Type::Atom(right)) => {
let atom = match (left, right) {
(Atom::Boolean, Atom::Boolean) => Atom::Boolean,
(Atom::Integer, Atom::Integer) => Atom::Integer,
(Atom::Number, Atom::Number)
| (Atom::Integer, Atom::Number)
| (Atom::Number, Atom::Integer) => Atom::Number,
(Atom::String, Atom::String) => Atom::String,
(lhs, rhs) => {

The union of a string and bytes should probably be bytes, for now it'll be dropped or casted into a string.

{"oneOf": [{"type": "string"}, {"type": "string", "format": "bytes"}]}

Originally posted by @acmiyaguchi in #82 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant