twskj / pretty-swag

Pretty UI for Swagger spec
MIT License
122 stars 20 forks source link

File will not generate. Just hangs. #44

Closed jball98 closed 6 years ago

jball98 commented 6 years ago

Input: pretty-swag -i swagger.json

Output: Source: swagger.json Dest: doc.html Format: singleFile MarkDown: Disable Nav Bar: Normal Auto tags: Enable Initial Collapse [Path: false, Method: false, Tool :true] Theme: blue

It has been stuck at this for 5 minutes. No error message at all. It works with the petstore swagger file but not mine. Any ideas on what the problem could be?

jball98 commented 6 years ago

After 15 minutes: Error: RangeError: Invalid string length

twskj commented 6 years ago

Hey what went wrong? Maybe I can make a quick fix to prevent the hang. Let me know.

jball98 commented 6 years ago

Took me forever to find it. I have two identical ref's in my file. "$ref" : "#/definitions/SomeResponse" "$ref" : "#/definitions/SomeResponse" Swagger editor did not pick this up as an error. Is this the expected behavior in pretty-swag?

twskj commented 6 years ago

Pretty-swag uses json-ref-parser to resolve $ref. I think the circular $ref should be handled already. Do you have a sample I can look at?

twskj commented 6 years ago

I'll close this for now feel free to reopen.