oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

Cannot generate from a JSON specification

Open Inrixia opened this issue 3 years ago • 0 comments

When generating from a yaml spec this project converts to JSON first. However if given a JSON spec it still attempts to convert yaml to json failing...

error loading swagger spec in ./spec.json
: error converting YAML to JSON: yaml: line 6: found unknown escape characterexit status 1
hello.go:11: running "go": exit status 1

This means to generate off a JSON spec you have to first convert JSON to yaml and then generate which just converts it back...

Ideally there should at least be a flag to specify if the source is already JSON

Inrixia avatar Oct 01 '22 03:10 Inrixia