swagger-typescript-api icon indicating copy to clipboard operation
swagger-typescript-api copied to clipboard

Unable to use $ref in "paths"

Open bartekczyz opened this issue 3 years ago • 6 comments

Hello. I'm getting errors while generating typescript definitions for my api. Some paths are defined in other files, so I pass a $ref to them. Feel free to check out the minimal bug repro repository I made https://github.com/bartekczyz/swagger-typescript-api-bug-repro

I'm getting

TypeError: Cannot create property 'consumes' on string './paths/repro.yaml#/hello'

Is there a workaround I could use? 🤔

bartekczyz avatar Nov 09 '22 13:11 bartekczyz

Ok, for now I'm using speccy resolve to put all $refs into one big file

bartekczyz avatar Nov 09 '22 17:11 bartekczyz

@bartekczyz will be fixed

js2me avatar Nov 12 '22 22:11 js2me

Hello I met same problem. Could you let me know when the fix of this issue will be released???

SuTechDevelop avatar Feb 08 '23 09:02 SuTechDevelop

Hello @js2me, any updates on this? :)

bartekczyz avatar Apr 26 '23 11:04 bartekczyz

We're also running into this, we had to rename a large set of endpoints and have to support the old names as well as the new names for a time being and would like to be able to reference in paths to reduce duplication and avoid maintenance errors...

I don't want to pre-compile and dereference everything because then we lose model names which we use quite a bit.

Jackman3005 avatar Oct 25 '23 00:10 Jackman3005