ogen
ogen copied to clipboard
Correctly parsing example PetStore YAML v3
Description
Currently the "canonical example" of a version 3 open-api document is at:
- https://petstore3.swagger.io/api/v3/openapi.yaml
- https://petstore3.swagger.io/api/v3/openapi.json
When running a generate.go
file with the contents:
package generate
//go:generate go run github.com/ogen-go/ogen/cmd/ogen@latest --target xyzzy --package xyzzy --clean openapi.yaml
The following error is returned:
$ go generate ./...
- openapi.yaml:744:15 -> xml: unexpected field for type "string"
741 | items:
742 | type: string
743 | xml:
→ 744 | name: photoUrl
745 | tags:
746 | type: array
747 | xml:
748 | wrapped: true
generation failed:
main.run
/home/xxxxxxxx/go/pkg/mod/github.com/ogen-go/[email protected]/cmd/ogen/main.go:302
exit status 1
generate.go:4: running "go": exit status 1
I know you are still working on ogen and you know I'm in love with your project.
Would it be possible to document how the "canonical examples" need to change so that ogen will process them? (Or better improve ogen so that it will generate code from the canonical examples)