twskj/pretty-swag

File will not generate. Just hangs.

jball98 opened this issue · 5 comments

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?

After 15 minutes: Error: RangeError: Invalid string length

twskj commented

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

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

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

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