Adding a Max/Min constraint only allows you to set Integers when using JDL, fields such as Double should allow a . in the constraint.
Using the generator prompts works as expected. JDL exported from app that then fails to import:
entity Foo {
test Double min(0.001)
}
Error message:
error: Error message:
MismatchedTokenException: Expecting --> ')' <-- but found --> '.' <--
at line: 1, column: 31
Error during import-jdl: Error: MismatchedTokenException: Expecting --> ')' <-- but found --> '.' <--
at line: 1, column: 31
SyntaxError: Error: MismatchedTokenException: Expecting --> ')' <-- but found --> '.' <--
at line: 1, column: 31
at callApiMethod (/Users/ruddell/Contrib/generator-jhipster/node_modules/jhipster-core/lib/readers/jdl_reader.js:99:11)
at parse (/Users/ruddell/Contrib/generator-jhipster/node_modules/jhipster-core/lib/readers/jdl_reader.js:83:10)
at Object.parseFromContent (/Users/ruddell/Contrib/generator-jhipster/node_modules/jhipster-core/lib/readers/jdl_reader.js:54:10)
at Object.createImporterFromContent (/Users/ruddell/Contrib/generator-jhipster/node_modules/jhipster-core/lib/jdl/jdl_importer.js:68:29)
at JDLProcessor.importJDL (/Users/ruddell/Contrib/generator-jhipster/cli/import-jdl.js:304:36)
at module.exports (/Users/ruddell/Contrib/generator-jhipster/cli/import-jdl.js:478:21)
at Command.command.allowUnknownOption.description.action.args (/Users/ruddell/Contrib/generator-jhipster/cli/cli.js:71:36)
at Command.listener (/Users/ruddell/Contrib/generator-jhipster/node_modules/commander/index.js:315:8)
at emitTwo (events.js:126:13)
at Command.emit (events.js:214:7)
If I add quotes around 0.001 it gives a different error
SyntaxError: Error: NoViableAltException: Expecting: one of these possible Token sequences:
1. [INTEGER]
2. [NAME]
but found: '"0.001"'
Motivation for or Use Case
You should be able to specify a decimal point in the min/max constraint when supported in the field type.
Reproduce the error
jhipster import-jdl --inline "entity Foo { test Double min(0.001) }"
Related issues
Did not find any related issues
Suggest a Fix
Not sure, have not looked into it.
JHipster Version(s)
Master, v6.6.0, v6.5.0
JHipster configuration, a .yo-rc.json file generated in the root folder
Overview of the issue
Adding a Max/Min constraint only allows you to set Integers when using JDL, fields such as Double should allow a
.
in the constraint.Using the generator prompts works as expected. JDL exported from app that then fails to import:
Error message:
If I add quotes around
0.001
it gives a different errorMotivation for or Use Case
You should be able to specify a decimal point in the min/max constraint when supported in the field type.
Reproduce the error
jhipster import-jdl --inline "entity Foo { test Double min(0.001) }"
Related issues
Did not find any related issues
Suggest a Fix
Not sure, have not looked into it.
JHipster Version(s)
Master, v6.6.0, v6.5.0
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions