-
Notifications
You must be signed in to change notification settings - Fork 7
Add JSON Schema and individual schema files #145
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
Conversation
0cd8735 to
48110d7
Compare
48110d7 to
1ecd679
Compare
1ecd679 to
492216b
Compare
492216b to
93e7929
Compare
77b09cc to
a931914
Compare
e986db5 to
642490d
Compare
642490d to
bd86c63
Compare
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.
ashfame
left a comment
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 good!
schemas/blog-post.json
Outdated
| @@ -0,0 +1,15 @@ | |||
| { | |||
| "title": "Blog Post", | |||
| "slug": "blog_post", | |||
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.
We decided on SubjectType enum to have dash as opposed to underscore earlier, we should keep both consistent, whatever that is. Personally, I think dash is better in all contexts where we might display it to the user or have it in the url?
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 think we should use what's allowed via the custom post types allowed in WordPress: https://developer.wordpress.org/reference/functions/register_post_type/
Post type key. Must not exceed 20 characters and may only contain lowercase alphanumeric characters, dashes, and underscores. See sanitize_key() .
If we say we do 4 letter prefixes this would leave 16 chars of the above and we can do dashes instead of underscores.
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.
Ok, I've made it so that dashes are accepted (underscores are not), and I've limited the length to 16 characters. This would mean that the post_type prefix that we use must not exceed 4 characters, for example twp_. If we end up using a longer prefix, we need to reduce the max length accordingly.
akirk
left a comment
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 good! I just added a couple of notes and noticed that we are mixing spaces and tabs indentation, I believe the JSON files can be tab indented as well.
akirk
left a comment
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, thank you!
Fixes #134
This PR adds the
./schemas/directory, but it is not used from anywhere yet.The schemas can be validated with:
Summary of changes
./schemas/slugReferences