acacode / swagger-typescript-api

Generate the API Client for Fetch or Axios from an OpenAPI Specification
MIT License
3.37k stars 361 forks source link

Unable to use $ref in "paths" #447

Open bartekczyz opened 2 years ago

bartekczyz commented 2 years ago

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 commented 2 years ago

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

js2me commented 2 years ago

@bartekczyz will be fixed

SuTechDevelop commented 1 year ago

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

bartekczyz commented 1 year ago

Hello @js2me, any updates on this? :)

Jackman3005 commented 1 year ago

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.

h3llomoto commented 1 month ago

@js2me hi there, any updates?