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

Bug during generation: error message expected ';', found 'if' #1327

Open
yawnak opened this issue Oct 12, 2024 · 1 comment
Open

Bug during generation: error message expected ';', found 'if' #1327

yawnak opened this issue Oct 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@yawnak
Copy link

yawnak commented Oct 12, 2024

What version of ogen are you using?

$ go list -m github.com/ogen-go/ogen

github.com/ogen-go/ogen v1.4.1

Can this issue be reproduced with the latest version?

YES

What did you do?

Tried to generate code from schema

Command:
//go:generate go run github.com/ogen-go/ogen/cmd/ogen@latest --target petstore petstore.yml

Link to schema on google drive: LINK

What did you expect to see?

I expected generated code without errors

What did you see instead?

Error after generate

INFO convenient Convenient errors are not available {"reason": "operation has no "default" response", "at": "petstore.yml:15:9"}
generate:
main.run
/home/yawnak/go/pkg/mod/github.com/ogen-go/[email protected]/cmd/ogen/main.go:379

  • write:
    main.generate
    /home/yawnak/go/pkg/mod/github.com/ogen-go/[email protected]/cmd/ogen/main.go:100
  • template "response_encoders":
    github.com/ogen-go/ogen/gen.(*Generator).WriteSource.(*Generator).WriteSource.func1.func2
    /home/yawnak/go/pkg/mod/github.com/ogen-go/[email protected]/gen/write.go:299
  • goimports:
  • oas_response_encoders_gen.go:93:23: expected ';', found 'if'
    exit status 1
    generate.go:3: running "go": exit status 1
@yawnak yawnak added the bug Something isn't working label Oct 12, 2024
@yawnak
Copy link
Author

yawnak commented Oct 12, 2024

#1328
here is a PR with fix for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant