sngular / scs-multiapi-plugin

This is a Maven plugin designed to help developers automatizing the creation of code classes from YML files based on AsyncApi and OpenAPI.
http://sngular.com
Mozilla Public License 2.0
48 stars 10 forks source link

enum generation #319

Closed neinoi closed 9 months ago

neinoi commented 9 months ago

I have an enum with this kind of values :

      enum:
      - '1234'
      - '2345'
      - '3456'

The generation gives :

      public enum Code {
          1234("1234"),
          2345("2345"),
          3456("3456"),
      …

As Java does not accept numeric for Java : « A variable's name can be any legal identifier — an unlimited-length sequence of Unicode letters and digits, beginning with a letter, the dollar sign "$", or the underscore character "_" »

I think the simplier way would be to add a "_" before each constant in the enum in these cases.

Version used : 5.3.3

github-actions[bot] commented 9 months ago

Thank you for collaborating with the project by giving us feedback! Cheers!

neinoi commented 9 months ago

Note : It’s for an asyncapi generation (don’t know if the same problem occurs with openapi)

neinoi commented 9 months ago

Problem solved with version 5.3.4