Repository navigation
[pull] master from OpenAPITools:master - #809
Merged
Merged
Conversation
…4983) Preserve nested property paths using recursive bracket notation and indexed arrays. Document the OpenAPI extension and cover encoding, dates, nullish values and existing query styles in the Angular sample tests.
* fix: [typescript-fetch] explode object query parameters
A query parameter whose schema is an object and whose style/explode are left at
their defaults — style: form, explode: true — must go on the wire as one
parameter per entry, keyed by the property name alone. The typescript-fetch
client bracketed it as filter[category]=books instead.
typescript-fetch/apis.mustache gated the explode branch on isContainer, which
DefaultCodegen.fromParameter only sets via updateParameterForMap, which in turn
needs ModelUtils.isMapSchema (so, additionalProperties). A bare type: object
instead goes through setTypeProperties, which sets isMap and isFreeFormObject
and leaves isContainer false. The parameter was therefore assigned whole and the
runtime's querystringSingleKey bracketed it. The branch is now keyed on isMap;
inside {{^isArray}}, isContainer implies isMap, so this is the same condition
plus free-form objects.
TypeScriptFetchClientCodegen's ExtendedCodegenParameter copy constructor copied
isExplode and style but not isDeepObject, isFormStyle, isMatrix,
isAllowEmptyValue, isSpaceDelimited or isPipeDelimited, so all six were false in
every typescript-fetch template regardless of the document. This is independent
of the template fix, and it is why fixing the template alone would have broken
deepObject parameters — they are explode: true too.
The loop body gains an `as any` cast on the indexing. It is not needed for a
declared map, but a free-form object is typed `object` and object[key] is
error TS7053 under strict, which is how most consumers compile.
* fix: [typescript-fetch] leave out a null entry of an exploded object
The runtime turned a null or undefined entry into k=null or k=undefined;
the loop now skips it, as the other ports do. Only isDeepObject is read
by the templates, so the copy constructor keeps that flag alone. The
mustache comment shrinks to one line, and the shared fixture's
description names the three combinations it covers.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix: [typescript-fetch] keep an exploded entry named __proto__
Assigning queryParameters['__proto__'] hits the Object.prototype setter
and drops the entry, while the runtime keeps such a key under deepObject
and in nested objects. The loop now defines the property instead.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test: [typescript-fetch] say the null-skip assertion pins emitted code
The codegen test cannot run the generated client, so its comment now
says it locks the code shape; the wire behaviour was checked separately.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Apply suggestion from @cubic-dev-ai[bot]
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
…size (#24898) * [swift] fix: models on a reference cycle become classes so they compile A struct that stores itself inline - through any chain of model-typed properties, Optional included - has infinite size: "value type cannot have a stored property that recursively contains it", and every struct that embeds it is infinite in turn. The generators emitted structs unconditionally, so any self- or mutually-referencing schema produced a client that does not compile; the only escape was useClasses=true, which turns every model into a class. Detect inline reference cycles in postProcessAllModels (containers break recursion on the heap and are not edges) and render only the models on a cycle as final classes - heap allocation provides the indirection, the wire format is unchanged, and everything else stays a struct. In swift6 a recursion-breaking class is @unchecked Sendable, the way readonlyProperties classes already are, so the Sendable structs embedding it still conform. The per-model rendering flag also carries the global useClasses value, and the useClasses samples (urlsession, vapor, swift5 and swift6 alike) regenerate byte-identical. Fixes #15240 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GcwZ1arjLZNpetHz2a3TJz * [swift] fix: allOf composition is not an inline-storage edge Review pointed out that allOf parents are flattened into allVars rather than stored inline, so treating the composed reference as an edge could mark models that store nothing recursively. Real cycles introduced by the flattening still surface through the allVars properties themselves; oneOf/anyOf keep their edges, since those render as enums with inline associated values. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GcwZ1arjLZNpetHz2a3TJz * [swift5][swift6] test: allOf is not a storage edge; tidy the cycle detection Pin bb5244e's behaviour: Base references Derived, which inherits Base through allOf. Only Derived is on a cycle (through its flattened `related`), so Base must stay a struct; with allOf counted as an edge it became a class. Also shortens the Javadoc, drops a double blank line and inlines swift5's `recursive` local. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )