Stereotype «OpenAPIEnumeration»
Stereotype «OpenAPIEnumeration»
can be used to mark an enumeration to be part of an OpenAPI specification.
JEAF Generator also supports so called “extensible enums”. From a semantic versioning perspective added new literals to an enumeration is a breaking change. However in reality this is a quite common case. If you want to avoid the breaking change then you can work with extensible enums. By convention for them its not considered to be a breaking change if you add an additional literal.
To support developers in this scenarios JEAF Generator is able to generate extensible enums. In such a case type x-extensible-enum
is used instead of enum
.
Stereotype | «OpenAPIEnumeration» |
|
---|---|---|
Applicable Elements | Enumeration |
|
Tagged Values | ||
Name | Type | Description |
extensibleEnum |
Boolean |
If set to true the enumeration is an extensible enum.Default value: false |
hasDynamicLiterals |
Boolean |
Typically enumeration literals are directly defined on an enumeration in the UML model. However, there might be cases where the literals should be resolved from somewhere else. For such cases JEAF Generator allows to dynamically resolve literals. Therefore, in addition to setting this tag to true also jeafgenerator/api/OpenAPIEnumExtensionPoint.ext has to be implemented. There the dynamic literals have to be returned by function List[String] getDynamicLiteralNames(JMM::OpenAPIEnumeration enum) .It is also supported to mix model defined and dynamic literals. |
Generated by JEAF Generator