Closed tomasciccola closed 7 months ago
Since we are now integrating the default config into CoMapeo and validating it given schemas in mapeo-schema, there are some fields with incorrect types. Mainly I've found two (which are the only ones that don't pass schema validation):
- name -> the
type
property as a value oflocalized
but on mapeo-schema we don't accept that value for that property (see)
I think since we don't support a localizable fields in the UI at the moment, then we should convert these to a field type of text
. (this is a field type supported by iD editor, and follows a common standard in OSM of adding localized fields appended with a :${LANG_CODE}
. In the iD interface you can add multiple translations for a localizable field, e.g. for the city of london. We can look at adding this feature at a later stage, at which point we can add this to the schema)
building-type
- the
options
field is formated as a list ofstring
, where is should actually be a list of{label:string, value: any}
(so, an object with a label and a value, see)
We should update the default config to the label and value format - this was a legacy format we used to support but have now dropped.
- the
type
property as a value ofselect-one
when it should beselectOne
I think ok to change the default config to use camelCase. I initially wondered if we had it for compat with iD Editor field types, but iD does not have select one and select multiple anyway. camelCase, while not everyone's preference, is what we are using everywhere so we should keep it as such for consistency.
- missing
label
property which is required
We should add this to the default config where it is missing.
Since we are now integrating the default config into CoMapeo and validating it given schemas in mapeo-schema, there are some fields with incorrect types. Mainly I've found two (which are the only ones that don't pass schema validation):
type
property as a value oflocalized
but on mapeo-schema we don't accept that value for that property (see)options
field is formated as a list ofstring
, where is should actually be a list of{label:string, value: any}
(so, an object with a label and a value, see)type
property as a value ofselect-one
when it should beselectOne
label
property which is requiredThe main solution for this would be to change this fields so that they pass validation, the second would be to change the schemas so that the fields are valid. I'm more inclined to the first option, but there maybe reasons that I don't know for maintaining this fields as is...
Also, there may be other invalid fields or presets, I'm still patching these errors live so that I can see what is missing...