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

consider making comma escapable \, #20

Open
matthiaskrgr opened this issue Sep 5, 2019 · 1 comment
Open

consider making comma escapable \, #20

matthiaskrgr opened this issue Sep 5, 2019 · 1 comment
Assignees
Labels
bug Something isn't working feature Requested features OV-lang concerns the openVALIDATION language

Comments

@matthiaskrgr
Copy link
Member

Currently if we have a rule that contains a ,, everything surrounding it is automatically parsed as array, even if we want to have a string that contains a comma.

schema:

{ name: 'Brockhaus,Peter' }

rule
name has to be Brockhaus\,Peter

cmd:

 java -jar openvalidation-cli/target/openvalidation.jar --culture en --language javascript --rule "name has to be Brockhaus\,Peter" --schema "{ name: 'Brockhaus,Peter'  }"

generates the code

            huml.appendRule("",
                   ["name"],
                   "name has to be Brockhaus\,Peter",
                   function(model) { return huml.NONE_OF(model.name, ["Brockhaus","Peter"]);},
                   false
                );

It might be useful if we could escape the comma inside a rule like so: \,

@matthiaskrgr matthiaskrgr added feature Requested features OV-lang concerns the openVALIDATION language labels Sep 5, 2019
@jages jages added the bug Something isn't working label Jan 31, 2020
@thecodemonkey
Copy link
Contributor

For this case we need a generic functionality that explicitly marks joined strings. FOR EXAMPLE

name has to be "Brockhaus, Peter"

or

name has to be 'Brockhaus, Peter'

it would solve many other problems ;-)

@jages jages assigned jages and unassigned lionelpa Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature Requested features OV-lang concerns the openVALIDATION language
Projects
None yet
Development

No branches or pull requests

4 participants