Add JSON Schema and individual schema files - #145
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
| @@ -0,0 +1,15 @@ | |||
| { | |||
| "title": "Blog Post", | |||
| "slug": "blog_post", | |||
There was a problem hiding this comment.
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.
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.
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.
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.
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