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

[JDL] Importing a file containing "all" as an Entity's property fails #390

Closed amatosg closed 4 years ago

amatosg commented 4 years ago
Overview of the issue

I have a jh file with many entities. One of them has allowLoginAfterHours as a property. When I import that jh file with 6.4.1 it fails with following message:

SyntaxError: Error: MismatchedTokenException: Expecting --> '}' <-- but found --> 'all' <-- 
at line: 57, column: 5

Moving the property to another line will be reported on error message.

Motivation for or Use Case

I should be able to import a JDL file with entities having properties that start with all.

Reproduce the error
Related issues

Unknown

Suggest a Fix

Not sure where the check happens

JHipster Version(s)

6.4.1

JHipster configuration
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.almasoft.facturapp"
    },
    "jhipsterVersion": "6.4.1",
    "applicationType": "monolith",
    "baseName": "FacturApp",
    "packageName": "com.almasoft.facturapp",
    "packageFolder": "com/almasoft/facturapp",
    "serverPort": "8080",
    "authenticationType": "session",
    "cacheProvider": "caffeine",
    "enableHibernateCache": true,
    "websocket": "spring-websocket",
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "rememberMeKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "embeddableLaunchScript": false,
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "angularX",
    "clientTheme": "spacelab",
    "clientThemeVariant": "primary",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": false,
    "blueprints": []
  }
}

Entity configuration(s) entityName.json files generated in the .jhipster directory

I have no entities

Browsers and Operating System

macOs

Love JHipster? Please consider supporting our collective: 👉 https://opencollective.com/generator-jhipster/donate

ruddell commented 4 years ago

Thanks for reporting, there's already a related issue in the jhipster-core repository.

Duplicate of https://github.com/jhipster/jhipster-core/issues/389

amatosg commented 4 years ago

thanks

MathieuAA commented 4 years ago

This has been fixed in JCore, I'll release a new version soon. Sorry for the inconvenience :)