fix(params): honour integer/number format for query & path parameters (#23)#24
Merged
Merged
Conversation
`analyze_parameter` hardcoded `Integer => i64` and `Number => f64`, ignoring the schema `format` and bypassing the `TypeMapper` that the schema-property path already routes through. A `format: int32` query parameter therefore always rendered as `i64`, and no `[type_mappings]`/strategy config could override it because the mapper was never consulted. Route parameter integer/number types through `TypeMapper::integer_format`/`number_format`, matching the property path: `int32 -> i32`, `int64 -> i64`, `float -> f32`, `double -> f64`, formatless integers stay `i64`, and config now applies to parameters. Adds tests/parameter_integer_format_test.rs covering int32/int64/ formatless integer and float/double query parameters. Fixes #23 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Closed
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lightsofapollo
added a commit
that referenced
this pull request
Jul 11, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Problem
Fixes #23.
Query and path parameters ignored the schema
format.analyze_parameterinsrc/analysis.rshardcoded the Rust type per OpenAPI type:This bypassed
TypeMapper, which the schema-property path already routes through. So anint32field inside a body correctly becamei32, but the sameformat: int32on a query/path parameter always becamei64. Because the mapper was never consulted, no[type_mappings]or[generator.types.strategies]config could override it either — matching the reporter's "whatever I do, I always get i64."Fix
Route parameter integer/number types through
TypeMapper::integer_format/number_format, identical to the property path:int32 -> i32,int64 -> i64float -> f32,double -> f64i64(unchanged default)[type_mappings]/ strategy config now applies to parametersTests
tests/parameter_integer_format_test.rsasserts the generated client signature for query parameters:int32 -> i32,int64 -> i64, formatless integer-> i64,float -> f32,double -> f64.Verification
cargo test --all-features— greencargo clippy --all-features -- -D warnings— cleancargo fmt --check— cleanscripts/spec-compile.sh anthropic openai— both PASS🤖 Generated with Claude Code