Repository navigation
fix(runtime): serialize parameters by declared style - #192
Conversation
Signed-off-by: samzong <samzong.lu@gmail.com>
Merging this PR will degrade performance by 43.84%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | large |
1.2 ms | 2.2 ms | -47.43% |
| ❌ | BenchmarkBuildFlat |
1 ms | 2 ms | -47.35% |
| ❌ | yaml |
2.7 ms | 5 ms | -47.23% |
| ❌ | large |
871.7 µs | 1,617.1 µs | -46.1% |
| ❌ | small |
64.8 µs | 118.6 µs | -45.34% |
| ❌ | yaml-large |
8.2 ms | 14.9 ms | -45.19% |
| ❌ | BenchmarkParseNormalize |
3.9 ms | 7.2 ms | -45.08% |
| ❌ | miss |
1.9 ms | 3.5 ms | -44.96% |
| ❌ | hit |
2 ms | 3.6 ms | -44.78% |
| ❌ | BenchmarkFormatTableInferredColumns |
608.4 µs | 1,092.6 µs | -44.32% |
| ❌ | BenchmarkCatalogJSON |
1.6 ms | 2.8 ms | -44.04% |
| ❌ | small |
77.6 µs | 138.2 µs | -43.82% |
| ❌ | json |
730 µs | 1,291.4 µs | -43.47% |
| ❌ | large |
891.5 µs | 1,576.7 µs | -43.46% |
| ❌ | json-small |
142.1 µs | 246.2 µs | -42.27% |
| ❌ | BenchmarkFindCatalogCommand |
4.6 µs | 7.9 µs | -41.79% |
| ❌ | small |
81.1 µs | 138.5 µs | -41.4% |
| ❌ | table |
414.1 µs | 706.2 µs | -41.36% |
| ❌ | large |
1.3 ms | 2.2 ms | -40.76% |
| ❌ | small |
103.8 µs | 174 µs | -40.33% |
| ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing fix/parameter-serialization (ed23ca7) with main (34a1e47)
…zation Signed-off-by: samzong <samzong.lu@gmail.com> # Conflicts: # docs/cli-usage.md # docs/contracts.md # pkg/runtime/catalog_projection_test.go # pkg/runtime/catalog_schema.go # pkg/runtime/spec.go
Summary
Closes #117.
style,explode, andallowReservedare preserved on parameters and honored on the wire: pathsimple/label/matrix, queryform/spaceDelimited/pipeDelimitedwith and without explode, andallowReservedfor query values.cookie-<flag>.[]stringflags. Swagger 2collectionFormatmaps to the equivalent style for query and path arrays; header arrays keep the existing joined-string behavior.tsvand unsupported path formats fail codegen with an error naming the originalcollectionFormat.deepObject, and similar) fail codegen after overlays are applied, so an overlayignore: trueon the operation is the escape hatch. The reported error is deterministic and matched by operation ID, method, and path.session,sid,csrf, and existing sensitive header/query names) stay redacted. Debug query redaction also covers;-separated segments without rewriting separators.Verification
make checkpassed.go test -race ./pkg/runtime/... ./internal/codegen/... ./internal/lathecmd/...passed.examples/richapi:lathe codegen -cache fixtures, build,__lathe verify --jsonreturnedok: true. Dry-run of an array query showed?limit=20&roles=a+b,c%2FdandCookie: tenant=x%20y.allowReserved, cookie escaping, auth cookie ordering, cursor and offset pagination from page 2 onward, andInvokeOperation; dry-run URLs match the wire. Its findings (cookie flag collisions, auth cookie leakage in dry-run, weak cookie sensitivity, Swagger headerssv/pipes, duplicate operation IDs withignore, nondeterministic errors,;query redaction) are fixed and were re-verified.Not verified:
allowReservedvalues that already contain percent-encoded triplets are encoded again (%41becomes%2541); this is out of scope. Live services with cookie parameters were not exercised.Compatibility
runtime.SchemaVersion21 andruntime.CatalogSchemaVersion28; regenerate downstream CLIs.collectionFormatnow default tocsv(k=a,b) as the specification requires, instead of repeated keys.stringto[]string; overlay shortcut presets or context bindings that target them fail codegen.Checklist
internal/generated/,.cache/, and ad-hocskills/<cli-name>/directories is not committed.