Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Various language improvements #236

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

Merged
Relequestual merged 5 commits into json-schema-org:master from awwright:aaa-a
Feb 1, 2017
Merged

Conversation

@awwright
Copy link
Member

@awwright awwright commented Jan 27, 2017

No description provided.

Copy link
Contributor

@handrews handrews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

While I still think we need to sort out a lot of things about what "default" really means, I agree that "has the same behavior" is an improvement. And I don't want to delay Draft 06 for a more thorough change, so I'm in favor of this.

I have a couple of other minor comments, mostly around how schemas can now be booleans and not just objects.

<t>
Most validation keywords only limit the range of values within a certain primitive type.
When the primitive type of the instance is not of the type targeted by the keyword, the
Most validation keywords only exclude a range of values within a certain primitive type.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about

Most validation keywords only constrain values within a certain primitive type.

We've often talked about validation as a constraint system, and I think it feels more intuitive than talking about exclusion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The language is sort of tricky overall... revised

</t>
<t>
A missing keyword has the same behavior as an empty schema.
</t>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we specify this as a true schema instead of an empty schema? Admittedly, the behavior is the same but true conveys the intent of permitting everything more clearly.

Copy link
Member

@epoberezkin epoberezkin Jan 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so too

Copy link
Member Author

@awwright awwright Jan 31, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"empty schema" is language that was used before (that this PR doesn't introduce), can we work on this in a new PR and call this one good?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If empty schema vs true is the only concern, I endorse doing that in a follow-up PR. We should check for it in more places than just these lines, and that will be trivially easy to check up on on its own.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's the thing, it's used quite a few times

Elements of the array MUST be objects. Each object MUST be a valid JSON
Schema.
Elements of the array MUST be objects.
Each object MUST be a valid JSON Schema.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we just want to say

Each element of the array MUST be a valid JSON Schema.

in order to allow boolean schemas as well.

Elements of the array MUST be objects. Each object MUST be a valid JSON
Schema.
Elements of the array MUST be objects.
Each object MUST be a valid JSON Schema.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing:

Each element of the array MUST be a valid JSON Schema.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that's what we did at first and then it was changed back for some reason... idk. I'll do this though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe I changed it like that in a PR that I ended up dropping? The boolean schema thing went through a few variations before we settled on it. Whatever happened, I think just saying "valid JSON Schema" is the best option- we already define what that means in an obvious place (the core spec).

This keyword's value MUST be an object. This object MUST be a valid JSON
Schema.
This keyword's value MUST be an object.
This object MUST be a valid JSON Schema.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing:

This keyword's value MUST be a valid JSON Schema.

Of course, {"not": true} doesn't make much sense, I think it should be syntactically valid.

Copy link
Contributor

@handrews handrews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Let's let @Relequestual and @epoberezkin weigh in since they had somewhat different opinions of the "same behavior" part, but this looks good to me.

Copy link
Contributor

@epoberezkin , @Relequestual are y'all OK with this? I'd like to get these fixes merged if so. There is no behavior change so it doesn't need to sit open for weeks.

awwright reacted with thumbs up emoji

Copy link
Member

I need more time to review this PR. I feel in some places it's actually more confusing, and I have ideas how to fix that, but I can't do it right now.

<t>
A missing keyword has the same behavior as an empty schema.
</t>
</section>
Copy link
Member

@Relequestual Relequestual Feb 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the phrasing "A missing key word...", does not make me think that the missing key word in question is THIS key word (as in, the key word in where the phrase is being used).
I would much rather prefer something like "Omitting this key word has the same effect as...". I feel the intent is far clearer.

If it's just me that feels this way, please say.

Copy link
Member Author

@awwright awwright Feb 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's exactly the word I was looking for, actually

Copy link
Member Author

awwright commented Feb 1, 2017

@Relequestual How's it look now

Copy link
Member

@Relequestual Relequestual left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good in my books! =D

Copy link
Member

As such... I'm merging!

@Relequestual Relequestual merged commit 703c107 into json-schema-org:master Feb 1, 2017
@awwright awwright deleted the aaa-a branch February 1, 2017 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Relequestual Relequestual Relequestual approved these changes

+2 more reviewers

@handrews handrews handrews approved these changes

@epoberezkin epoberezkin epoberezkin left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /