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

JDL Enum comment error #14869

Closed
1 task done
standors opened this issue May 4, 2021 · 7 comments
Closed
1 task done

JDL Enum comment error #14869

standors opened this issue May 4, 2021 · 7 comments

Comments

@standors
Copy link

standors commented May 4, 2021

Overview of the issue

error occure at generating code for JDL enum with comment /** */ in enum body
e.g.
enum myEnum { V1 /** value1 */, V2 /**value2 */, V3 }

error at JDL import:
error: Syntax error message:
MismatchedTokenException: Found an invalid token '/** value1 /', at line: 125 and column: 9.
Please make sure your JDL content does not use invalid characters, keywords or options.
Error during import-jdl: Error: MismatchedTokenException: Found an invalid token '/
* value1 */', at line: 125 and column: 9.
Please make sure your JDL content does not use invalid characters, keywords or options.

Motivation for or Use Case

We design enum names short like abbreviation because it is DB table column, but want to provide comment in order to explain the meaning.
This comment should be exported also to swagger to provide the information to API users.

Reproduce the error

error occurs always

Related issues
Suggest a Fix
JHipster Version(s)

"jhipsterVersion": "7.0.0-beta.1",

JHipster configuration

{
"generator-jhipster": {
"promptValues": {
"packageName": "ev",
"nativeLanguage": "sk"
},
"jhipsterVersion": "7.0.0-beta.1",
"applicationType": "microservice",
"baseName": "evidencia",
"packageName": "shr.ev",
"packageFolder": "shr/ev",
"serverPort": "8090",
"authenticationType": "oauth2",
"cacheProvider": "hazelcast",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "postgresql",
"prodDatabaseType": "postgresql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": "eureka",
"buildTool": "maven",
"enableSwaggerCodegen": false,
"jwtSecretKey": ...
"embeddableLaunchScript": false,
"creationTimestamp": 1580462360848,
"testFrameworks": [],
"jhiPrefix": "jhi",
"entitySuffix": "",
"dtoSuffix": "DTO",
"otherModules": [],
"enableTranslation": true,
"clientPackageManager": "npm",
"nativeLanguage": "sk",
"languages": ["sk", "en"],
"blueprints": [],
"skipClient": true,
"skipUserManagement": true,
"entities": [
.....
],
"skipServer": false,
"skipCheckLengthOfIdentifier": false,
"skipFakeData": false,
"pages": [],
"reactive": false,
"clientFramework": "angularX",
"clientTheme": "none",
"clientThemeVariant": "",
"withAdminUi": true,
"lastLiquibaseTimestamp": 1619103677000
}
}

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2021

This issue is stale because it has been open 30 days with no activity.
Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted.
We are accepting PRs 😃.
Comment or this will be closed in 7 days

@MathieuAA
Copy link
Member

Keep open

@swarajsaaj
Copy link
Contributor

For enum types, the javadocs are currently completely ignored while generating the files and a default javadoc is added as seen here :-

As javadocs are now allowed after #15202, they can be added in the generated files as well (at enum type and item level).

For the open-api I am not sure if the comments can be added at item level, but a type level description is suggested at https://swagger.io/docs/specification/data-models/enums/

All values in an enum must adhere to the specified type. If you need to specify descriptions for enum items, you can do this in the description of the parameter or property:

@MathieuAA Shall we add the javadocs in generated file, and any suggestions for swagger comments?

@MathieuAA
Copy link
Member

For swagger comments, I guess the regular comments can be used.

@MathieuAA
Copy link
Member

And the javadocs should already be present :(

@swarajsaaj
Copy link
Contributor

Working on the javadocs part first, will try to submit a PR soon.

swarajsaaj added a commit to swarajsaaj/generator-jhipster that referenced this issue Jun 17, 2021
@swarajsaaj swarajsaaj mentioned this issue Jun 17, 2021
6 tasks
swarajsaaj added a commit to swarajsaaj/generator-jhipster that referenced this issue Jun 17, 2021
swarajsaaj added a commit to swarajsaaj/generator-jhipster that referenced this issue Jun 18, 2021
@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity.
Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted.
We are accepting PRs 😃.
Comment or this will be closed in 7 days

swarajsaaj added a commit to swarajsaaj/generator-jhipster that referenced this issue Aug 8, 2021
swarajsaaj added a commit to swarajsaaj/generator-jhipster that referenced this issue Aug 8, 2021
@MathieuAA MathieuAA reopened this Aug 14, 2021
swarajsaaj added a commit to swarajsaaj/generator-jhipster that referenced this issue Aug 15, 2021
Trim trailing spaces from JDL parser

Related to jhipster#14869
swarajsaaj added a commit to swarajsaaj/generator-jhipster that referenced this issue Aug 16, 2021
swarajsaaj added a commit to swarajsaaj/generator-jhipster that referenced this issue Aug 16, 2021
@mshima mshima reopened this Aug 22, 2021
@mshima mshima reopened this Aug 30, 2021
@pascalgrimaud pascalgrimaud added this to the 7.2.0 milestone Sep 11, 2021
@pascalgrimaud pascalgrimaud reopened this Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants
@mshima @MathieuAA @DanielFran @swarajsaaj @pascalgrimaud @standors and others