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

Fails to automagically bind default values to query param objects before validation

Open wjase opened this issue 3 years ago • 3 comments

If you add a default value to a query param it is not reflected in the generated code. so you have to hand code your default in the service layer and mark it as optional and deal with a pointer when in fact it should always be there.

wjase avatar Mar 13 '22 01:03 wjase

I have a PR in the works to fix this for query params at least on echo servers. The changes should be usable in the other templates too

wjase avatar Mar 13 '22 02:03 wjase

https://github.com/deepmap/oapi-codegen/pull/540 fixes this for the echo server

wjase avatar Mar 13 '22 11:03 wjase

Hi, any updates about the merge?

smallhive avatar Mar 07 '24 10:03 smallhive