Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to unset a tag in the question catalog definition #270

Open
wielandb opened this issue Jul 1, 2024 · 2 comments
Open

Add possibility to unset a tag in the question catalog definition #270

wielandb opened this issue Jul 1, 2024 · 2 comments
Labels
feature request New feature request

Comments

@wielandb
Copy link
Contributor

wielandb commented Jul 1, 2024

Idea

It would be great if it would be possible to define the answer to a question in a way that some tag gets removed if it is set.

Bug Relation

No response

Implementation

The JSON could look like this:

      {
          "name": "Example answer",
          "osm_tags": {
            "exampleTag": "exampleValue",
            "tagThatShouldBeRemoved": None
          }
      },

Where a tag in osm_tags whose value is None/null will be removed if present.

Additional Info

No response

@wielandb wielandb added the feature request New feature request label Jul 1, 2024
@Robbendebiene
Copy link
Member

I agree that this might be helpful in the future if we support "alternative answers". Because sometimes something got removed but the tag is still present causing OpenStop to ask an unanswerable question.

Currently any expression in the constructor returns null whenever an error occurs. It is then treated as a noop. Of course this could be changed so whenever we return null and a tag is present we remove the tag. Still I think it is worth considering alternatives.

Alternatives are

  • empty string ""
  • bool: false
  • reserved placeholders {{my_placeholder}}
  • special constructor expression [DELETE]

@wielandb
Copy link
Contributor Author

My favourite at this point would be false, because:

  • false in a condition already means "not set" and thus the meaning transpires
  • Using an empty string or reserved placeholders might work, but it always leaves some room for error/ambiguity
  • A constructor expression would surely also work, but would be more complex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature request
Projects
None yet
Development

No branches or pull requests

2 participants