Standardize field attributes
The json-table-schema spec gives the following attributes:
-
name -
title -
description -
typedrawn fromstring,number,integer,boolean,null,object,array,datetime,date,time,duration,geopoint,geojson,any -
formatfor date/time fields, drawn fromdefault(ISO6801),any(parseable by standard libraries),fmt:PATTERNwith astrptime-stylePATTERN
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:
-
precisionandscalefornumberfields -
tagssee #92
I think it's also worth keeping the default attribute.
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".
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.
They are truly horrible names; I have to look them up whenever I have to deal with them.