Skip to content

Conversation

@ankushKun
Copy link

Implements #11655

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
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
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
Contributor

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

@ivanbranco
Copy link

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.

@k-yle k-yle linked an issue Dec 15, 2025 that may be closed by this pull request
Copy link
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?

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

5 participants