Skip to content

11655: show warning if invalid ref:REI input tag is found#11656

Closed
ankushKun wants to merge 1 commit intoopenstreetmap:developfrom
ankushKun:warn_invalid_REI
Closed

11655: show warning if invalid ref:REI input tag is found#11656
ankushKun wants to merge 1 commit intoopenstreetmap:developfrom
ankushKun:warn_invalid_REI

Conversation

@ankushKun
Copy link
Copy Markdown

Implements openstreetmap/id-tagging-schema#2055

Added REI tag validation logic to modules/validations/invalid_format.js
Added en localization for the same to data/core.yaml

When an invalid value is entered to a ref:REI tag, a warning is displayed to the user

Valid formats: A string of length 8 characters 00000000 or in the format 00-00-0000

image

@tordans
Copy link
Copy Markdown
Collaborator

tordans commented Dec 8, 2025

@ankushKun please review the codebase on how alerts like this are handled. IMO you will find that we do not add them on a tag by tag basis manually deep in the code but instead search for abstractions like id-tagging-schema and similar.

@ankushKun
Copy link
Copy Markdown
Author

@tordans should I be adding the ref:REI tag to https://github.com/openstreetmap/id-tagging-schema first? since I cannot find it anywhere in the current codebases

@matkoniecz
Copy link
Copy Markdown
Contributor

@tordans Can tagging schema support such validations? Do we have any such formats specified there?

@ivanbranco
Copy link
Copy Markdown

Valid formats: A string of length 8 characters 00000000 or in the format 00-00-0000

The REI reference doesn't include dashes, so the only valid format should be an 8 character string. More precise validations could be added (e.g. the first three characters are always letters), but even a simple length check would already be useful.

Copy link
Copy Markdown
Collaborator

@k-yle k-yle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than hardcoding random tags, it would be better to use id-tagging-schema's existing pattern field, if at all.

This requires the key ref:REI to be defined in the tagging schema first. I think this is a good thing, because:

  1. it makes us go through the usual process of determing whether ref:REI deserves a field in the UI
  2. iD's validation issues should be fixable. A warning about a tag that's hidden in the UI is likely to be confusing for new users.

It's also worth considering if this warning is actually a good idea. What are mappers supposed to do if the value is invalid? Perhaps this would be better suited for osmose?

@matkoniecz
Copy link
Copy Markdown
Contributor

It's also worth considering if this warning is actually a good idea. What are mappers supposed to do if the value is invalid? Perhaps this would be better suited for osmose?

or maybe create (limited) number of notes where format mismatches expected one? (only in places without nearby notes)

this way it is more likely to be looked by expert mappers actively looking for problems to fix

@Marc-marc-marc
Copy link
Copy Markdown
Contributor

Marc-marc-marc commented Mar 10, 2026

It's also worth considering if this warning is actually a good idea. What are mappers supposed to do if the value is invalid?

delete the incorrect ref or fill the correct one

Perhaps this would be better suited for osmose?

I think that a warning during mapping is very better than uploading a invalid data, wating a QA to detect it and/or open a not-for-qa-reporting (bad pratice ?) and wait that someone (maybe not the initial mapper) find why the 1st mapper fill an invalid data and where the correct one is

@tyrasd
Copy link
Copy Markdown
Member

tyrasd commented Mar 13, 2026

see #11656 (review)

@tyrasd tyrasd closed this Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add warning for ref:REI=* values

7 participants