ideditor / schema-builder

🏗🏷 Create tagging schemas for iD
ISC License
12 stars 16 forks source link

Add functionality to reference "fields" of other preset as "moreFields" #53

Open tyrasd opened 2 years ago

tyrasd commented 2 years ago

Sometimes, in a "special case" preset one would like to keep parent fields only as "moreFields". For example, see https://github.com/openstreetmap/id-tagging-schema/pull/423 where all generic building fields should be optional fields. Currently this can only be modeled by manually copying the fields of the building preset into the moreFields of the garages preset.

A possible solution could look like this:

    "moreFields": [
        "{building#fields}",
        "{building}"
    ],

Alternatively, a reference like "moreFields": ["{building}"] could also be implemented to automatically include all fields from the referenced preset as moreFields, if they are not yet included as regular fields in the new preset. This would, however, make it very difficult to completely remove a field in a sub-preset.