Skip to content
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

Using json schema format rather than defined patterns #5

Closed
lauraclarke opened this issue Sep 22, 2017 · 4 comments
Closed

Using json schema format rather than defined patterns #5

lauraclarke opened this issue Sep 22, 2017 · 4 comments
Labels
infrastructure Update to code or repo infrastructure.

Comments

@lauraclarke
Copy link
Member

JSON schema has a tag called format which allows you to specify a string field should match a given format

It would be good for date, email and URI files to use this for validation rather than patterns as is currently the case.

Looking at contact.json

"email": {
"description": "Email of contact for contributingauthors",
"pattern": "^.@...*$",
"type": "string"
},

would be expressed as

"email": {
"description": "Email of contact for contributingauthors",
"type": "string"
"format": "email"
},

The full list of formats can be found here
http://json-schema.org/latest/json-schema-validation.html#rfc.section.8.3

This would seem much more in keeping with the idea of using JSON schema to valid content

@malloryfreeberg malloryfreeberg added the infrastructure Update to code or repo infrastructure. label Nov 22, 2017
@daniwelter
Copy link
Member

@malloryfreeberg This may be of interest to what you're currently reviewing.

@lauraclarke
Copy link
Member Author

Have we used this now? @daniwelter @malloryfreeberg Can this issue be closed?

@malloryfreeberg
Copy link
Member

@daniwelter added date-time format to many fields. We didn't change the email field, but I will make that change now and tag this issue so that it closes when we merge.

daniwelter added a commit that referenced this issue Feb 8, 2018
…rmat

Changed from pattern to format for email field. Fixes #5.
@daniwelter
Copy link
Member

Pattern has been replaced in all instances where a format is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Update to code or repo infrastructure.
Projects
None yet
Development

No branches or pull requests

3 participants