Hi,
I was just getting started with oapi-codegen, and thanks a lot for the awesome tool!
One question I have, is that - unless I'm doing something wrong - the request body isn't automatically unmarshalled, so you have to do something like this: https://github.com/deepmap/oapi-codegen/blob/master/examples/petstore-expanded/echo/api/petstore.go#L85-L86
func (p *PetStore) AddPet(ctx echo.Context) error {
// We expect a NewPet object in the request body.
var newPet NewPet
err := ctx.Bind(&newPet)
Whereas, for the other types of parameters, you get a handy struct with things pre-filled:
https://github.com/deepmap/oapi-codegen/blob/master/examples/petstore-expanded/echo/api/petstore.go#L53
func (p *PetStore) FindPets(ctx echo.Context, params FindPetsParams) error {
Is that by design? Not a massive issue, but wouldn't it make more sense to treat the bodies the same way?
Thanks!
Hi,
I was just getting started with
oapi-codegen, and thanks a lot for the awesome tool!One question I have, is that - unless I'm doing something wrong - the request body isn't automatically unmarshalled, so you have to do something like this: https://github.com/deepmap/oapi-codegen/blob/master/examples/petstore-expanded/echo/api/petstore.go#L85-L86
Whereas, for the other types of parameters, you get a handy struct with things pre-filled:
https://github.com/deepmap/oapi-codegen/blob/master/examples/petstore-expanded/echo/api/petstore.go#L53
Is that by design? Not a massive issue, but wouldn't it make more sense to treat the bodies the same way?
Thanks!