-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Framework: add schema for current user #3356
Conversation
export default { | ||
type: [ 'integer', 'null' ], | ||
minimum: 0 | ||
} |
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.
Arguing the smallest of points, but I wonder why ESLint doesn't identify this as needing a semi-colon? In my mind it should I'd think.
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.
;) Looks complicated: eslint/eslint#2194 (comment)
Looks and works well for me 👍 On an unrelated note, do you have a recommended reference for JSON Schema aside from the website? The specs are... well, specs 😄 I do this tool handy for validating from a schema: http://jsonschemalint.com/ |
👍 @aduth thanks for reviewing!
I've been a bit of a magpie and have been looking at a lot of misc docs. If I find a particularly good one I'll be sure to share it. It does look like there's some nice generators that take in sample JSON and return a generated schema. This might be useful if we have a particularly large object. |
440586b
to
78590ee
Compare
Framework: add schema for current user
This adds a schema for current-user to avoid data shape changing errors, as described in #3101 Also tidies up a test to use sinon rather than mockery.
Testing Instructions
ENABLE_FEATURES=persist-redux make run
calypso:state
cc @rralian @aduth @artpi @mtias