Skip to content

feat(sdk): improve free-form JSON ergonomics#105

Merged
matoous merged 1 commit intomainfrom
md/free-form-ergonomics
Apr 22, 2026
Merged

feat(sdk): improve free-form JSON ergonomics#105
matoous merged 1 commit intomainfrom
md/free-form-ergonomics

Conversation

@matoous
Copy link
Copy Markdown
Contributor

@matoous matoous commented Apr 22, 2026

Update the code generator and SDK runtime so free-form object schemas are exposed as a JsonObject helper instead of raw JsonDocument/JsonElement shapes, improving the authoring experience for payloads like Apple Pay / Google Pay data, metadata, tags, and other additionalProperties: true maps while keeping the wire format unchanged. This also updates generated dictionary-only models to inherit from JsonObject and adds regular generator and SDK tests covering the new mapping, serialization, and parsing behavior.

  var readerCheckout = new CreateReaderCheckoutRequest
  {
      Description = "Coffee",
      TotalAmount = new CreateReaderCheckoutRequestTotalAmount
      {
          Currency = "EUR",
          MinorUnit = 2,
          Value = 450,
      },
      Affiliate = new CreateReaderCheckoutRequestAffiliate
      {
          AppId = "com.example.pos",
          ForeignTransactionId = "order-123",
          Key = "affiliate-key",
          Tags = new JsonObject
          {
              ["store_id"] = "berlin-01",
              ["cashier_id"] = 42,
              ["sandbox"] = true,
          },
      },
  };

@matoous matoous self-assigned this Apr 22, 2026
Update the code generator and SDK runtime so free-form object
schemas are exposed as a `JsonObject` helper instead of raw
`JsonDocument`/`JsonElement` shapes, improving the authoring experience
for payloads like Apple Pay / Google Pay data, metadata, tags, and
other `additionalProperties: true` maps while keeping the wire format
unchanged. This also updates generated dictionary-only models to
inherit from `JsonObject` and adds regular generator and SDK tests
covering the new mapping, serialization, and parsing behavior.
@matoous matoous force-pushed the md/free-form-ergonomics branch from cae7523 to 78edf31 Compare April 22, 2026 22:31
@matoous matoous merged commit 4101373 into main Apr 22, 2026
12 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 20, 2026
@matoous matoous deleted the md/free-form-ergonomics branch April 22, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant