Skip to content

Url-encode OAuth2 query parameters in Android, Apple and Unity #2019

Closed

Description

@ChiragAgg5k

Tracks PR #2018.

Plan

Goal: Encode OAuth2/GET query parameter keys and values so &, +, #, and = inside a value (e.g. OAuth2 state, a success URL with a query or fragment) are not split, decoded to a space, or truncated.

What changes:

  • templates/android/library/src/main/java/io/package/services/Service.kt.twig — Uri.encode on keys/values when building OAuth2 apiQuery
  • templates/apple/Sources/Client.swift.twig and templates/swift/Sources/Client.swift.twig — rewrite parametersToQueryString to percent-encode per RFC 3986 unreserved set, join with &
  • templates/dotnet/Package/Extensions/Extensions.cs.twig — Uri.EscapeDataString per key/value in ToQueryString (covers Unity + .NET)
  • mock-server/app/http.php + tests/resources/spec-openapi3.json — new GET /v1/mock/tests/general/query (general.getQuery) that rejects anything but value=a&b+c#d=e%f and values=[a&b, c+d#e]
  • tests/e2e/Base.php — QUERY_ENCODING_RESPONSES; wired into Apple/Swift/.NET/Unity e2e suites and language tests (Tests.swift / Tests.cs). Android OAuth2 URL is browser-redirect-only, so no Android e2e line.

Remaining steps: The linked PR is the full change.

Done when:

Activity

  1. self-assigned this
    on Oct 13, 2026
  2. ChiragAgg5k commented on Oct 15, 2026

    @ChiragAgg5k
    MemberAuthor

    Released in sdk-generator 5.7.2 (contains merged PR #2018).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions