jhipster / jhipster-core

JHipster Domain Language, used by JHipster UML and JDL-Studio to generate entities
Apache License 2.0
346 stars 116 forks source link

import-jdl throws and error for variable that start with 'all' such as 'allowXyz' #389

Closed lancescape closed 4 years ago

lancescape commented 4 years ago
Overview of the issue

Using the command jhipster import-jdl ResourceManagement.jh --json-only on the jdl below. oddly starting a variable with 'all' such as "allowMultiple Boolean required" throws the error

Motivation for or Use Case

error: Error message: MismatchedTokenException: Expecting --> '}' <-- but found --> 'all' <-- at line: 7, column: 5 SyntaxError: Error: MismatchedTokenException: Expecting --> '}' <-- but found --> 'all' <-- at line: 7, column: 5 Error while parsing applications and entities from the JDL SyntaxError: Error: MismatchedTokenException: Expecting --> '}' <-- but found --> 'all' <-- at line: 7, column: 5

Reproduce the error

jhipster import-jdl ResourceManagement.jh --json-only

Related issues

none

Suggest a Fix

if I change the JDL variable name from allowMultiple to alowMultiple it works. probably has to do with the 'all' option feature used throughout

JHipster Version(s)

6.4.1

JHipster configuration
JDL definitions
entity ActivityOption {
    name String required maxlength(30),
    description String maxlength(255),
    optionPresentation OptionPresentationType  required,
    mandatory Boolean required,
    updatableSelection Boolean required,
    allowMultiple Boolean required
}

  
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

Windows 10 build 1909, chrome (latest)

MathieuAA commented 4 years ago

I'll look into it, thanks for reporting this one

MathieuAA commented 4 years ago

I've identified the problem and work is being done to fix it

MathieuAA commented 4 years ago

Fixed, I'll release a new version soon.