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
Initial commit of schema definition for invalid updates. #1083
base: master
Are you sure you want to change the base?
Initial commit of schema definition for invalid updates. #1083
Conversation
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.
A few comments as I read up on JSON schema :)
docs/invalid_update.schema.json
Outdated
"reason": { | ||
"type": "string", | ||
"title": "The reason Schema", | ||
"examples": [ | ||
"INVALID_JSON", | ||
"DELETED" | ||
] | ||
} |
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.
Should this have an enum
field for the valid reasons?
If so, we could probably remove the examples.
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.
Oooh good call, I didn't realise you could do that.
docs/invalid_update.schema.json
Outdated
"default": [], | ||
"title": "The invalid_records Schema", |
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.
nit: most of these titles don't really seem useful, and I don't think they're a required field.
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've improved on them.
docs/invalid_update.schema.json
Outdated
"title": "The invalid_records Schema", | ||
"items": { | ||
"type": "object", | ||
"title": "A Schema", |
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 title is particularly unhelpful :)
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.
Ah yes, yes it is. Improved.
Defer to the consolidated examples putting everything together.
* Use better titles * Specify the supported reasons as an enum
This is my first foray into writing a JSON schema, and I've basically done it using https://www.jsonschema.net/app/schemas/231529 so let me know if you see any issues with it (including things like
$id
)Contributes to #771