gs-gs / staruml-cefact

StarUML extensions to support UN/CEFACT edi3 tools & methods specifications.
18 stars 7 forks source link

many swagger validation errors but model seems ok #125

Open onthebreeze opened 4 years ago

onthebreeze commented 4 years ago

please try to general OpenAPI specification for the diagram called "PreferentialCoO" in the "Certificates" package of the mmt model file at https://github.com/edi3/edi3-transport/tree/develop/resources

Many swagger errors are generated - but I cant see anything wrong with the model.

kshychko commented 4 years ago

@faizanvahevaria, I'll pick this one - there are missing values for enums. Will let you know if need any assistance.

faizanvahevaria commented 4 years ago

Yes i found that enums lengh is zero so that swagger parser generates error

kshychko commented 4 years ago

I played a bit and came to the following solution:

  1. If the enumeration is present on the diagram - it gets included along with the values. This allows us to override the published code lists.
  2. If the enumeration is missing from the diagram but has a tag named "ref", it is included as a reference pointing to the address provided as the "ref" tag value.
  3. If the enumeration is missing and there is no "ref" tag, it is included with an empty "enum" array and the alert message is shown. The generated spec is invalid.

@onthebreeze, I think it is a working approach on how to manage your code lists or use published. I'll publish MMT and ISO code and update the MMT project with "ref" tags.