-
-
Notifications
You must be signed in to change notification settings - Fork 964
Description
Hello, oapi-codegen generates an invalid code when I define requestBody
as text/plain uuid.
I would appreciate it if you could advise me on how to fix this.
How to reproduce
$ cat > openapi.yaml <<EOS
openapi: 3.0.3
paths:
/pet:
post:
requestBody:
content:
text/plain:
schema:
type: string
format: uuid
EOS
$ go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest openapi.yaml > gen.go
$ go mod init openapi
$ go mod tidy
$ go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run
output:
gen.go:1: : # gen
./gen.go:135:40: cannot convert body (variable of array type PostPetTextRequestBody) to type string (typecheck)
// Package openapi provides primitives to interact with the openapi HTTP API.
exit status 1
Lastly, thank you for maintaining such a great tool. Really appreciate it!
Metadata
Metadata
Assignees
Labels
No labels