jhipster / jhipster-core

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

JDL annotations should allow strings with spaces and utf-8 characters. #472

Closed mshima closed 4 years ago

mshima commented 4 years ago
Overview of the issue

Annotations with spaces inside values like:

@entityClassHumanized("Foo Bar")
entity FooBar {
  name String
}

Exits with error:

error: Syntax error message:
    NoViableAltException: Expecting: one of these possible Token sequences:
  1. [NAME]
  2. [INTEGER]
  3. [DECIMAL]
but found: '"foo bar"'
Motivation for or Use Case

Useful for custom labels. See https://github.com/jhipster/generator-jhipster/pull/11981

More specifically for utf-8 characters, where generated i18n is almost useless:

@entityClassHumanized("Instituição")
@entityClassPluralHumanized("Instituições")
entity Instituicao {
  name String
}
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)
JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
mshima commented 4 years ago

@MathieuAA I was thinking about adding annotations support to application.config like:

aplication {
  @customAnnotation
  config {
    baseName foo
  }
}

What don you think?

MathieuAA commented 4 years ago

What does it add?

mshima commented 4 years ago

A workaround to https://github.com/jhipster/jhipster-core/issues/448

aplication {
  @blueprintSpecificConfig
  config {
    baseName foo
  }
}
mshima commented 4 years ago

@MathieuAA never mind, it's harder than I anticipated: https://github.com/mshima/jhipster-core/tree/config_annotation.

Can you release 7.3.3 for jhipster 6.10.0?

MathieuAA commented 4 years ago

Tomorrow yes! I'll have some free time

mshima commented 4 years ago

Great thanks 👍 .

mshima commented 4 years ago

Ping @MathieuAA

MathieuAA commented 4 years ago

It's done.

mshima commented 4 years ago

Sorry, my bad, didn’t saw, thanks.