ideditor / schema-builder

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

Undocumented field reference `rtype` #131

Open FaFre opened 6 months ago

FaFre commented 6 months ago

There is an undocumented field in references called rtype for which no documentation exists. It is also used just for one field (restrictions):

{
    "type": "restrictions",
    "geometry": [
        "vertex"
    ],
    "usage": "manual",
    "reference": {
        "rtype": "restriction"
    },
    "label": "Turn Restrictions"
}

It would be nice to either document or drop this field, to have a consistent schema.

tordans commented 6 months ago

I am assuming this is to trigger this special UI image

You could verify in the iD or Rapid codebase. A PR here would be great.

1ec5 commented 6 months ago

The reference property’s documentation doesn’t say it explicitly, but this object is supposed to list query parameters that the editor sends to taginfo or the OSM Wiki to look up documentation. Taginfo and the OSM Wiki need to know which tag or key corresponds to the preset or field.

In this case, we want the Turn Restrictions field to display documentation from the wiki’s “Relation:restriction” page via a taginfo relation type or from this data item via a MediaWiki API query for the permanent relation type ID property.[^key] It’s called rtype because iD used taginfo’s API long before it added support for data items.

I am assuming this is to trigger this special UI

That’s what the usage property is doing here.

[^key]: Ordinarily, one would expect a field to display documentation about a key, but restriction is primarily documented as a type of parking restriction rather than as a type of turn restriction, the much more common usage.