Repository navigation
fix(deps): update module github.com/oapi-codegen/runtime to v1.8.0 - #134
Open
renovate-sh-app[bot] wants to merge 1 commit into
Open
renovate-sh-app[bot] wants to merge 1 commit into
renovate-sh-app[bot] wants to merge 1 commit into
Conversation
| datasource | package | from | to | | ---------- | ------------------------------- | ------ | ------ | | go | github.com/oapi-codegen/runtime | v1.7.0 | v1.8.0 | Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v1.7.0→v1.8.0Release Notes
oapi-codegen/runtime (github.com/oapi-codegen/runtime)
v1.8.0: : Bind the request body value the validator sawCompare Source
This release adds a request body binder that reuses the value a kin-openapi validation middleware already decoded, so strict servers no longer decode the body a second time with different matching rules. It also rounds out
types.Date's text encoding and fixes adeepObjectserialization quirk. Existing binding and serialization behaviour is unchanged unless generated code calls the new function. The root module's dependencies are unchanged; the separatestrictmiddleware/echo-v5module now requires Echo v5.4.2.Notable Changes
BindJSONBody: bind exactly what the validator validatedStrict servers generated by
oapi-codegendecode the JSON request body withencoding/jsonafter a validation middleware has already decoded and validated it. The two decoders do not agree on member names:encoding/jsonmatches struct fields case-insensitively, so a body like{"role":"user","ROLE":"admin"}validates asrole: userand then binds asRole: "admin". Anything the validator checked can be bypassed by a differently-cased duplicate.BindJSONBody(r *http.Request, v any) errorcloses that gap. When the request has passed through a validator built on kin-openapi v0.151.0 or later withopenapi3filter.Options.KeepValidatedValueset, the body carries the value the validator decoded, andBindJSONBodybinds that value into the destination withBindJSONValue(value, v any) errorinstead of reading the body again. Binding followsencoding/json's rules (struct tags, embedded structs,json.Unmarshalerandencoding.TextUnmarshaler, base64 for[]byte,float64forany,json.Numberpreserved) with one deliberate difference: member names are matched to struct fields exactly.Without a validated value, or when the value cannot be bound into the destination type,
BindJSONBodyfalls back tojson.NewDecoder(r.Body).Decode(v), so error responses are unchanged for everyone who is not running a validator. The oapi-codegen validation middlewares enableKeepValidatedValueby default as of nethttp-middleware v1.3.1, echo-middleware v1.2.1, echo-v5-middleware v0.2.1, gin-middleware v1.2.1 and iris-middleware v1.2.1. The net/http strict server template that callsBindJSONBodyis landing inoapi-codegenseparately (oapi-codegen/oapi-codegen#2605); the runtime side ships first so generated code can rely on it.types.Dateimplementsencoding.TextMarshalerDatehad anUnmarshalTextthat parses2006-01-02but noMarshalText, so it inheritedtime.Time's RFC 3339 one. Any codec that pairsTextMarshalerwithTextUnmarshaler(encoding/xml, DynamoDB mappers, and others) therefore wrote aDateit could not read back.MarshalTextnow formats withDateFormat, matchingMarshalJSON,StringandUnmarshalText. Thanks to @jusabe-kreditz.deepObjectno longer emitsparam[]=nullfor nil maps and slicesMarshalling a
deepObjectparameter whose field held a typed nil map or nil slice produced aparam[]=nullpair, because the intermediatejson.Marshalturned the nil intonull. Such fields are now omitted, as an empty map or slice already was. Nil pointers are still serialized asnull, as before. Thanks to @SKalt (#160).🚀 New features and improvements
🐛 Bug fixes
📦 Dependency updates
6 changes
Sponsors
We would like to thank our sponsors for their support during this release.
New contributors
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
Need help?
You can ask for more help in the following Slack channel: #proj-renovate-self-hosted. In that channel you can also find ADR and FAQ docs in the Resources section.