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

Standardize field attributes #123

Open
gracebrownecodes opened this issue Feb 2, 2016 · 4 comments
Open

Standardize field attributes #123

gracebrownecodes opened this issue Feb 2, 2016 · 4 comments

Comments

@gracebrownecodes
Copy link
Contributor

The json-table-schema spec gives the following attributes:

  • name
  • title
  • description
  • type drawn from string, number, integer, boolean, null, object, array, datetime, date, time, duration, geopoint, geojson, any
  • format for date/time fields, drawn from default (ISO6801), any (parseable by standard libraries), fmt:PATTERN with a strptime-style PATTERN

and the following constraint attributes:

  • required (not null)
  • minLength
  • maxLength
  • pattern (regex to test values against)
  • minimum
  • maximum
  • enum

I think to this we should add:

@gracebrownecodes
Copy link
Contributor Author

I think it's also worth keeping the default attribute.

@murphyke
Copy link
Member

murphyke commented Feb 2, 2016

Re: precision, scale, and maxLength, I think it would be better to add separate precision and scale attributes. If you co-opt maxLength, it seems like it should be for precision, since that's the total number of digits, although doing so may cause confusion because people will not know if the decimal point is included in the "length".

@gracebrownecodes
Copy link
Contributor Author

Yeah, I got precision and scale confused, obviously. What terrible names. Anyway, I think you're right that we shouldn't co-opt maxLength for this purpose and instead should use separate attributes.

@murphyke
Copy link
Member

murphyke commented Feb 2, 2016

They are truly horrible names; I have to look them up whenever I have to deal with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants