feat: Pass schema type/formats to runtime v1.2.0 to allow better parameter serialization#2256
Merged
jamietanna merged 2 commits intooapi-codegen:mainfrom Feb 27, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…g functions Update all parameter binding and styling call sites across all server templates and the client template to pass the OpenAPI schema Type and Format through to the runtime library. This enables the runtime (v1.2.0+) to correctly handle format: byte parameters by base64-encoding/decoding the value, instead of incorrectly treating []byte as a generic []uint8 slice. Changes: - Add SchemaType() and SchemaFormat() helper methods to ParameterDefinition - Update BindStyledParameterWithOptions calls in all 7 server templates (echo, chi, stdhttp, gin, gorilla, fiber, iris) to include Type/Format - Replace BindQueryParameter with BindQueryParameterWithOptions in all 7 server templates, passing Type/Format via options struct - Replace StyleParamWithLocation with StyleParamWithOptions in client.tmpl, passing Type/Format via options struct - Regenerate all test fixtures Requires a minimum of runtime v1.2.0. Closes #173 Closes oapi-codegen#2248 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Greptile SummaryThis PR passes OpenAPI schema type and format information to the runtime library's parameter binding functions, fixing incorrect handling of Key Changes:
Impact: Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| pkg/codegen/operations.go | Added two helper methods (SchemaType, SchemaFormat) to extract OpenAPI schema metadata for parameters with proper nil checks |
| pkg/codegen/templates/chi/chi-middleware.tmpl | Updated parameter binding calls to pass OpenAPI type/format information to runtime functions |
| pkg/codegen/templates/client.tmpl | Updated client parameter styling calls to pass OpenAPI type/format information to runtime functions |
| pkg/codegen/templates/echo/echo-wrappers.tmpl | Updated parameter binding calls to pass OpenAPI type/format information to runtime functions |
| examples/go.mod | Updated runtime dependency to v1.2.0 to support new Type/Format parameter options |
| internal/test/go.mod | Updated runtime dependency to v1.2.0 and other transitive dependencies |
Last reviewed commit: 375bf71
jamietanna
approved these changes
Feb 27, 2026
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.
No description provided.