Skip to content

v1.9.1: Bugfix update

Latest

Choose a tag to compare

@github-actions github-actions released this 20 Nov 15:41
· 2 commits to main since this release
c67d5d3

This is a bugfix release. MarshalForm now honors the style and explode of a form property's encoding, and deepObject binding rejects integers that overflow their destination instead of wrapping them. There are no API changes, and code generated by current oapi-codegen releases behaves as before.

Notable Changes

MarshalForm honors style and explode

MarshalForm only read ContentType from a property's RequestBodyEncoding, so an array was always written with indexed keys, topic[0]=a&topic[1]=b, even when the encoding declared style: form, explode: true, which serializes as repeated keys, topic=a&topic=b. A property whose encoding sets Style or Explode is now serialized as a query parameter of that style would be: form, spaceDelimited and pipeDelimited repeat the key when exploded and write one delimited value otherwise, and deepObject is the existing bracketed form. Explode defaults to true for form and false for the other styles, as in the specification.

Properties with no encoding, or with one that sets neither field, are unchanged. Generated clients pass no encodings today, so their output is the same; a future oapi-codegen release will pass the spec's encodings through (oapi-codegen/oapi-codegen#2604). The application/json content type branch, which returned unsupported encoding for every content type including JSON, now works too (#187, closes #186).

deepObject integers that overflow are rejected

UnmarshalDeepObject parsed integer fields as 64-bit and assigned them without checking that the value fit, so ?filter[count]=4294967297 bound into an int32 as 1 with no error. Out-of-range values now fail with an overflows destination error, as they already did for the form style and the JSON binders. Thanks to @youdie006 (#185).

🐛 Bug fixes

📦 Dependency updates

  • chore(deps): update release-drafter/release-drafter action to v7.11.0 (#184) @renovate[bot]

Sponsors

We would like to thank our sponsors for their support during this release.

DevZero logo

Cybozu logo

  • No new contributors