Comparing vikstrous:5bb2934...oapi-codegen:ee2e591 · vikstrous/runtime
Commits on Feb 24, 2026
-
Support array of objects parameters (oapi-codegen#40)
* test update * fix array of objects unmarshaling * update tests * update tests * update tests * chore: revert cosmetic changes to deepobject.go Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Marcin Romaszewicz <marcinr@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
3 people authored
Feb 24, 2026 -
fix: improve email validation using net/mail package (oapi-codegen#60)
* fix: improve email validation using net/mail package * fix: improve email validation using net/mail package * fix: update test expectations for email validation behavior change Invalid emails no longer persist their value after failed UnmarshalJSON validation, since the new net/mail-based validation sets the value only after successful parsing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Marcin Romaszewicz <marcinr@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
3 people authored
Feb 24, 2026 -
feat(fix): bump gin version (oapi-codegen#51)
* feat(fix): bump gin version * feat: bump gin to v1.10.1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Marcin Romaszewicz <marcinr@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
3 people authored
Feb 24, 2026
Commits on Feb 26, 2026
-
fix: add Type/Format-aware parameter binding and styling for []byte (o…
…api-codegen#97) (oapi-codegen#98) When an OpenAPI spec uses type: string, format: byte, the generated Go code produces *[]byte fields. Previously the runtime treated []byte as a generic []uint8 slice -- splitting on commas and parsing individual integers -- instead of base64-encoding/decoding it as a single value. This commit adds Type and Format string fields (matching the OpenAPI spec type/format) to the Options structs for parameter binding and styling functions. When Format is "byte" and the destination is []byte, the runtime base64-encodes (styling) or base64-decodes (binding) the value as a single string. New WithOptions functions and options structs: - BindStringToObjectWithOptions + BindStringToObjectOptions - StyleParamWithOptions + StyleParamOptions - BindQueryParameterWithOptions + BindQueryParameterOptions Extended existing options struct: - BindStyledParameterOptions: added Type and Format fields Existing functions delegate to WithOptions with zero-value options, preserving backward compatibility for all current callers. Encoding uses base64.StdEncoding (standard alphabet, padded) per OpenAPI 3.0 / RFC 4648 Section 4. Decoding is lenient: it inspects padding and URL-safe characters to select the correct decoder, avoiding the silent corruption that occurs when RawStdEncoding accepts padded input. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
-
fix: support non-indexed deepObject array unmarshaling (oapi-codegen#22…
…) (oapi-codegen#96) OpenAPI 3.0's deepObject style has undefined behavior for arrays. Two conventions exist in the wild: - Indexed: p[vals][0]=a&p[vals][1]=b (oapi-codegen's current format) - Non-indexed: p[vals]=a&p[vals]=b (Swagger UI / Rails convention) Swagger UI generates the non-indexed format, which previously failed with "[field] has multiple values". This change makes UnmarshalDeepObject accept both formats by detecting repeated query parameter keys and expanding them into synthetic indexed entries (e.g. [vals][0], [vals][1]) before feeding them into the existing tree-construction and assignment logic. Marshaling (MarshalDeepObject) intentionally remains unchanged and continues to emit the indexed format. The indexed format is unambiguous, already consumed correctly by all known implementations, and is what oapi-codegen's own generated clients expect. Changing it to the non-indexed format would be a breaking change for consumers that rely on the current wire format, with no practical benefit since both formats are now accepted on the unmarshaling side. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
-
feat: add BindRawQueryParameter for correct comma handling (oapi-code…
…gen#92) Add BindRawQueryParameter which operates on the raw (undecoded) query string instead of pre-parsed url.Values. For form/explode=false parameters, this splits on literal commas before URL-decoding each part, correctly preserving %2C as a literal comma in values. Also adds findRawQueryParam internal helper, comprehensive tests, and round-trip (serialize/deserialize) tests. Deprecates BindQueryParameter, which cannot distinguish delimiter commas from literal commas because url.Values pre-decodes %2C. Fixes oapi-codegen#91 Note: oapi-codegen/oapi-codegen will need to update its generated code to call BindRawQueryParameter (passing r.URL.RawQuery) once this change is released. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
-
fix: bind Date and Time query params as scalar values (oapi-codegen#21)…
… (oapi-codegen#93) BindQueryParameter treated all structs as key-value objects in the non-exploded form path, causing types.Date and time.Time to fail with "property/values need to be pairs". Scalar struct types that implement Binder or encoding.TextUnmarshaler are now bound directly via their interface methods instead of being routed to bindSplitPartsToDestinationStruct. Also adds Binder implementation to types.Date so it self-identifies as a scalar binding target. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Commits on Feb 28, 2026
-
fix: respect Binder interface for primitive types in BindStringToObje…
…ct (oapi-codegen#86) Previously, the Binder interface was only checked within the struct case of the type switch, causing primitive types (strings, ints, etc.) that implement Binder to bypass their custom binding logic. This fix moves the Binder check to the beginning of BindStringToObject, ensuring all types implementing Binder use their custom Bind method, regardless of their underlying type. The redundant check in the struct case has been removed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Viktor Stanchev <viktor@anchorlabs.com>
3 people authored
Feb 28, 2026
Commits on Mar 3, 2026
-
feat: add support for echo v5 (oapi-codegen#89)
* feat: add support for echo v5 * fix: move echo v5 strict types to own module as peer directory Move strictmiddleware/echo/v5/ to strictmiddleware/echo-v5/ with its own go.mod requiring Go 1.25, so the root module stays at Go 1.20. This avoids forcing all runtime users to upgrade to Go 1.25 just because echo v5 support was added. The echo-v5 package is a separate Go module with only the echo v5 dependency. Also changes package name from `v5` to `echo` to follow Go convention (matching how github.com/labstack/echo/v5 uses `package echo`). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore/update CI for nested modules The echo-v5 strict middleware requires Go 1.25+, which is ahead of the rest of the runtime module (Go 1.20). To support this as a separate child module, the CI and build tooling needed to become multi-module aware. - Replace four separate workflow files (ci.yml, lint.yml, tidy.yml, generate.yml) with a single ci.yml that calls the shared reusable workflow from oapi-codegen/actions v0.5.0 - Update the root Makefile to iterate child modules via git ls-files '**/*go.mod', matching the pattern used by oapi-codegen - Bump golangci-lint from v1.55.2 to v2.10.1 and update flags for v2 - Add tidy-ci target for the reusable workflow - Add strictmiddleware/echo-v5/Makefile with a Go version guard that skips gracefully when running on Go < 1.25 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Marcin Romaszewicz <marcinr@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
3 people authored
Mar 3, 2026
Commits on Mar 12, 2026
-
feat: improve parameter handling (oapi-codegen#109)
* feat: improve parameter handling Add AllowReserved support for OpenAPI parameter serialization Add the AllowReserved field to StyleParamOptions, BindStyledParameterOptions, and BindQueryParameterOptions. When set to true for query parameters, RFC 3986 reserved characters are left unencoded in the serialized output, per the OpenAPI 3.x allowReserved specification. Changes: - Add AllowReserved bool to all parameter option structs - Implement escapeQueryAllowReserved for custom escaping that preserves reserved characters while still encoding spaces and control characters - Thread allowReserved through internal helpers (stylePrimitive, styleSlice, styleStruct, styleMap, processFieldDict) - Fix styleStruct recursive call to use StyleParamWithOptions instead of StyleParamWithLocation, which was silently dropping options Partially resolves oapi-codegen/oapi-codegen#1342 Prerequisite for oapi-codegen/oapi-codegen#2183 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: encode parameter names in styled output for RFC 3986 compliance Add escapeParameterName helper that percent-encodes parameter names in the prefix/separator construction of styleSlice, stylePrimitive, and processFieldDict. This ensures characters like [] in parameter names (e.g. user_ids[]) are properly encoded as %5B%5D in query strings, per RFC 3986. Note: MarshalDeepObject handles its own serialization independently and does not yet encode parameter names in bracket notation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
-
fix: strip style prefix for label/matrix primitive parameters (oapi-c…
…odegen#99) (oapi-codegen#100) BindStyledParameterWithOptions passed the raw styled value directly to BindStringToObject for primitive types, without first removing the style prefix. This caused label (leading ".") and matrix (";param=") styles to fail with parse errors for non-struct, non-slice destinations. Route primitive values through splitStyledParameter — the same function already used by the struct and slice paths — so the prefix is stripped before binding. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Commits on Mar 18, 2026
-
Fix: Query param deepObject return without assign on !required (oapi-…
…codegen#68) * Fix: deepObject return without assign on !required * Add tests for deepObject required/optional query parameter binding Exercise the required and optional code paths for deepObject-style query parameters to verify no unintended side effects from PR oapi-codegen#68. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Marcin Romaszewicz <marcinr@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 people authored
Mar 18, 2026