Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Router / [post] creates panic #109

Open
tobwiens opened this issue Feb 19, 2016 · 2 comments
Open

@Router / [post] creates panic #109

tobwiens opened this issue Feb 19, 2016 · 2 comments

Comments

@tobwiens
Copy link

I have simple microservices which only do one operation and I let this operation happen on the root.

When I create asciidoc with a @router / [post] I get the following panic.

2016/02/19 21:21:30 Start parsing
2016/02/19 21:21:31 Can not parse comment for function: HandleLoginRequest, package: tobwiens/user/handle, got error: Can not pars
e response comment "200 {object}", skipped.
2016/02/19 21:21:31 Can not parse comment for function: HandleLoginRequest, package: tobwiens/user/handle, got error: Can not pars
e response comment "400 {object}", skipped.
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/yvasiyarov/swagger/parser.(*Parser).AddOperation(0xc08204c080, 0xc089bbcb00)
        C:/Users/Toby/Go/src/github.com/yvasiyarov/swagger/parser/parser.go:185 +0x9cc
github.com/yvasiyarov/swagger/parser.(*Parser).ParseApiDescription(0xc08204c080, 0xc082008660, 0x14)
        C:/Users/Toby/Go/src/github.com/yvasiyarov/swagger/parser/parser.go:423 +0x744
github.com/yvasiyarov/swagger/parser.(*Parser).ParseApi(0xc08204c080, 0xc082008660, 0x14)
        C:/Users/Toby/Go/src/github.com/yvasiyarov/swagger/parser/parser.go:225 +0x1fa
github.com/yvasiyarov/swagger/generator.Run(0xc082008660, 0x14, 0xc082005f50, 0x2b, 0xc082002230, 0x8, 0x0, 0x0, 0x0, 0x0, ...)
        C:/Users/Toby/Go/src/github.com/yvasiyarov/swagger/generator/generator.go:161 +0xb5a
main.main()
        C:/Users/Toby/Go/src/github.com/yvasiyarov/swagger/main.go:38 +0x1af

Cheers,
Tobias

@juanolon
Copy link

juanolon commented Apr 3, 2016

jep, just got the same error
github.com/yvasiyarov/swagger/parser.(*Parser).AddOperation(0xc08204c080, 0xc089bbcb00) C:/Users/Toby/Go/src/github.com/yvasiyarov/swagger/parser/parser.go:185 +0x9cc
Cheers

@yun-wang
Copy link

Got the same error with @Router / [get], is there a work-around for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants