-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
Change format keyword positioning #664
Change format keyword positioning #664
Conversation
…arirification added on the usage of format keyword
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.
Welcome to the JSON Schema Community. Thanks a lot for creating your first pull request!! 🎉🎉 We are so excited you are here! We hope this is only the first of many! For more details check out README.md file.
I checked the issue json-schema-org/json-schema-spec#759 and it was closed 2019. Are you sure you are referring to the right issue? |
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.
Great work Bhavuk, Thanks!!
to enable `format` to function as an assertion rather than just an | ||
annotation. That means that validation will fail if, for example, a | ||
value with a `date` format isn\'t in a form that can be parsed as a | ||
date. This can allow values to be constrained beyond what the other |
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.
Suggestion:
This allows values to be constrained beyond what the other tools in JSON Schema can do, including Regular Expressions.
|
||
- `"date-time"`: Date and time together, for example, | ||
`2018-11-13T20:20:39+00:00`. | ||
- `"time"`: <StarInline label="New in draft 7" /> Time, for example, `20:20:39+00:00` |
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.
- `"time"`: <StarInline label="New in draft 7" /> Time, for example, `20:20:39+00:00` | |
- `"time"`: <StarInline label="New in draft 7" /> Time, for example, `20:20:39+00:00`. |
|
||
There is a bias toward networking-related formats in the JSON Schema | ||
specification, most likely due to its heritage in web technologies. | ||
However, custom formats may also be used, as long as the parties |
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.
Suggestion:
However, custom formats may also be used if the parties exchanging the JSON documents share information about the custom format types
## Format[#format] | ||
|
||
The `format` keyword allows for basic semantic identification of certain | ||
kinds of values that are commonly used. or user could define its own format and use them alongside |
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.
kinds of values that are commonly used. or user could define its own format and use them alongside | |
kinds of commonly used, or a user could define their format and use them alongside |
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.
Grammatically, this still seems incomplete.
As written:
The
format
keyword allows for basic semantic identification of certain
kinds of values that are commonly used. or user could define its own format and use them alongside
- "... commonly used. or user could ..." - The second sentence seems to start in the middle of a thought.
- "and use them alongside" - Alongside what? This needs an object.
As suggested:
The
format
keyword allows for basic semantic identification of certain kinds of commonly used, or a user could define their format and use them alongside
- "certain kinds of commonly used..." - Commonly used what? Object needed.
- "and use them alongside" - Alongside what? This needs an object.
My suggestion:
The
format
keyword conveys semantic information for values that may be difficult or impossible to describe using JSON Schema. Typically, this semantic information is described by other documents. The JSON Schema Validation specification defines a number of formats, however this keyword also allows schema authors to define their own formats.
Hello, |
Co-authored-by: hridyesh bisht <41201308+kakabisht@users.noreply.github.com>
Co-authored-by: hridyesh bisht <41201308+kakabisht@users.noreply.github.com>
Co-authored-by: hridyesh bisht <41201308+kakabisht@users.noreply.github.com>
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.
@bhavukkalra please address the outstanding comments. We can merge afterward.
Hello! 👋 This pull request has been automatically marked as stale due to inactivity 😴 It will be closed in 180 days if no further activity occurs. To keep it active, please add a comment with more details. There can be many reasons why a specific pull request has no activity. The most probable cause is a lack of time, not a lack of interest. Let us figure out together how to push this pull request forward. Connect with us through our slack channel : https://json-schema.org/slack Thank you for your patience ❤️ |
This issue is going to be closed due to inactivity. |
What kind of change does this PR introduce?
PR moves the
format
section of the documentation from the misplaced string page to under the more generic type as discussed in Issue #759. Which aims to remove the Misinterpretation that the reader might get thatformat
as a keyword is only for string types which is not the case.Also, Add further clarification that
format
as a keyword is generic. Using these lines added furtherIssue Number:
Screenshots
format
section from string pageSummary
PR aims to re-adjust the positioning of
format
keyword definitions. To remove any confusion of it being astring
specific keyword as reported by the users here Slack ArchivesDoes this PR introduce a breaking change?
No
CC - @benjagm @gregsdennis @jviotti