jargon-sh / issues

The jargon.sh issue tracker
1 stars 0 forks source link

OpenAPI import does not import arrays the reference component correctly #4

Closed jcvanderwal closed 1 month ago

jcvanderwal commented 2 months ago

When importing an OpenAPI spec containting this snippet in a schema definition:

...
"placeOfDestination" : {  
  "$ref" : "#/components/schemas/ApiPort"  
},  
"goodsItems" : {  
  "type" : "array",  
  "items" : {  
    "$ref" : "#/components/schemas/ApiGoodsItem"  
  }
}
...    

it will be imported as:

...
 placeOfDestination:ApiPort
 goodsItems:Text[]
... 

but should be imported as:

...
 placeOfDestination:ApiPort
 goodsItems:ApiGoodsItem[]
... 
jargon-sh commented 2 months ago

Hi @jcvanderwal

Thanks for spotting & reporting this.

The following snippet

...
"properties": {
   "tags": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Tag"
      }
   }
...

Now is imported as:

Pet
 tags:Tag[]

If you try uploading your OpenAPI file again, I believe it will work for you now. If so, please close this issue.

Thanks again

jcvanderwal commented 1 month ago

Thanks!