ContextMapper / context-mapper-dsl

ContextMapper DSL: A Domain-specific Language for Context Mapping & Service Decomposition
https://contextmapper.org/
Apache License 2.0
223 stars 30 forks source link

Error when creating a list of Enums #325

Closed juan-conca closed 1 year ago

juan-conca commented 1 year ago

Describe the bug When I define a ValueObject that contains a reference to a List, complains about the attribute and fails.

To Reproduce Create your own Enum in the model:

        enum Roles {
            ENUM_1,
            ENUM_2,
            ENUM_3,
            ENUM_4
        }

Then in your ValueObject, make a reference to a list of them:

        ValueObject User {
            - List<Roles> roles;
        }

And when compile, then an error appears complaining about the line: - List<Roles> roles;

Expected behaviour I suppose that this must be accepted and usable in case of user with several roles, or an object with a list of accepted states to move, etc.

IDE and Plugin (please complete the following information):

Non-Bundled Plugins: com.intellij.kubernetes (223.7571.188) com.dubreuia (2.3.0) de.docksnet.puml.syntaxchecker (0.2.0) PlantUML integration (5.20) org.asciidoctor.intellij.asciidoc (0.38.3) org.mapstruct.intellij (1.4.0) com.haulmont.jpab (2022.5.1-223) org.sonarlint.idea (7.2.1.58118)

Kotlin: 223-1.7.20-release-201-IJ7571.182

Additional context Add any other context about the problem here.

stefan-ka commented 1 year ago

Thank you very much for reporting @juan-conca!

stefan-ka commented 1 year ago

I agree, we should allow this. The grammar is not the problem, but there is an explicit Sculptor validator that does not allow this; don't actually know why or what the thoughts were there. I think we can adjust this, but we have to check that all the generators can handle it.

stefan-ka commented 1 year ago

Fixed this one. Will be released with our next version in May.