Skip to content

[pull] main from fern-api:main#731

Merged
pull[bot] merged 12 commits into
code:mainfrom
fern-api:main
May 15, 2026
Merged

[pull] main from fern-api:main#731
pull[bot] merged 12 commits into
code:mainfrom
fern-api:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 15, 2026

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 : )

github-actions Bot and others added 12 commits May 15, 2026 17:58
…ynamic-snippet path parameters in IR order (#15885)

* fix(csharp, go, java, php, python, ruby, swift, typescript): render dynamic-snippet path parameters in IR order

The shared associateByWireValue helper in @fern-api/browser-compatible-base-generator
used to iterate over the input values object, which produced path parameters in
insertion/alphabetical order. Generated SDK signatures order path parameters by URL
position, so docs snippets could end up with arguments in the wrong order whenever the
spec listed them differently. Iterate over the IR parameter list instead, mirroring
associateByWireValueOrDefault, while preserving the existing 'parameter not recognized'
error semantics for unknown keys.

Also pass ignoreMissingParameters: true in java-v2 EndpointSnippetGenerator.getPathParameters
so endpoint-level path-param keys aren't flagged as unrecognized when the top-level
path-params pass runs (and vice versa).

Adds a regression test under the path-parameters fixture supplying values in
alphabetical order to verify they render in IR order.

Linear: FER-10546

* fix(ruby, swift): include root-level path parameters in dynamic-snippet method calls

Generated Ruby and Swift SDKs surface both root-level and endpoint-level
path parameters as keyword/labelled arguments on the endpoint method,
but the dynamic-snippet generators only emitted endpoint-level params,
silently dropping root-level params (e.g. tenant_id) and producing
snippets with malformed URLs.

Mirror the existing body-request handling by merging
context.ir.pathParameters with request.pathParameters in IR / URL order.

Refs FER-10546.

* fix(swift): coerce dynamic-snippet path parameter literals to String

The generated Swift SDK declares every path parameter as String in the
endpoint method signature (path values are interpolated into the URL
string). The dynamic-snippet generator previously rendered each path
parameter's literal using its IR-declared primitive type, so an integer
path parameter (e.g. version: INTEGER, value 7) was emitted as version: 7
against a version: String signature, producing a snippet that fails to
compile with 'cannot convert value of type Int to expected argument type
String'.

Render path-parameter values as Swift escaped String literals to match
the SDK signature.

Refs FER-10546.

* fix(python): include root-level path parameters in dynamic snippet method call

The python-v2 dynamic-snippet generator was passing root-level path
parameters (e.g. tenant_id) as keyword arguments to the client
constructor, but the generated Python SDK client only accepts
base_url, headers, timeout, max_retries, follow_redirects, httpx_client
and logging — so the snippet would raise

    TypeError: __init__() got an unexpected keyword argument 'tenant_id'

and the endpoint method would also raise

    TypeError: get_user_specifics() missing 1 required positional
    argument: 'tenant_id'

because root-level path parameters were dropped from the method call as
well.

Remove root-level path parameters from the constructor argument list and
merge them with endpoint-level path parameters in
getMethodArgsForInlinedRequest, mirroring the pattern already used by
getMethodArgsForBodyRequest. This brings python-v2's inlined-request
path in line with both its own body-request handling and the recent
Ruby-v2 / Swift fix for the same family of bug.

Refs FER-10546.

* fix(swift): remove unused moduleSymbol in getEndpointMethodArgsForBodyRequest

Dead code leftover from path-parameter String coercion refactor. The
function delegates to getEndpointMethodPathParameters and
getEndpointMethodBodyRequestArg, both of which re-fetch their own
moduleSymbol when needed.

Addresses Claude review finding on PR #15885.

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: dsinghvi <10870189+dsinghvi@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators May 15, 2026
@pull pull Bot added the ⤵️ pull label May 15, 2026
@pull pull Bot merged commit 0b54a93 into code:main May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant