The maintainer has not written a description at the source.
Repo oapi-codegen/echo-middleware, read from GitHub 1 h ago. oapi-codegen has not joined Take My Repo.
This release enables openapi3filter.Options.KeepValidatedValue by default. It was meant to ship in v1.2.0 together with the kin-openapi v0.152.0 update, but was merged after that release was published.
With it on, the validator leaves the request body readable exactly as before and additionally keeps the decoded, validated JSON value on the body, reachable through its ValidatedValue() any method. Upcoming oapi-codegen strict server templates use this to bind the value that was actually validated instead of decoding the body a second time, which closes the gap described in oapi-codegen/oapi-codegen#2605 (encoding/json matches member names case-insensitively, so a second decode can pick up a member the validator never saw).
Handlers that read the body see no difference. The only costs are that the decoded value stays in memory for the lifetime of the request, and that the body no longer implements optional interfaces such as io.WriterTo.
To opt out, set DiscardValidatedValue: true in this middleware's Options. This setting overrides KeepValidatedValue in the embedded openapi3filter.Options. Middleware that replaces the request body must run before the validator, otherwise the validated value is lost.
We would like to thank our sponsors for their support during this release.
This is a dependency update release. It moves the required kin-openapi version to v0.152.0, which also raises the minimum for every project using this middleware. It also fixes request bodies being drained before the handler when Options.Prefix is set (#49), thanks to @karlpip.
Behaviour changes that come with kin-openapi v0.150.0 to v0.152.0 and that users may notice:
encoding/json (this is decided by the toolchain, not by this middleware).$ref are ignored, as the specification requires.spaceDelimited and pipeDelimited query parameters default to explode: false.openapi3filter.Options.KeepValidatedValue is available for passing through Options.Options; it leaves the validated request body value on the request for handlers that can use it.This release also picks up the kin-openapi security fix from v0.149.0 (GHSA-r277-6w6q-xmqw) for anyone still on an older version.
We would like to thank our sponsors for their support during this release.
This release bumps the required Go version to 1.25, and pulls in a version of kin-openapi which can validate OpenAPI 3.1 specifications.
FUNDING.yml (#21) @jamietannaWe would like to thank our sponsors for their support during this release.
testutil dependency by @jamietanna in #7Full Changelog: v1.0.0...v1.0.1