Skip to content

Conversation

@philippthun
Copy link
Member

@philippthun philippthun commented Jan 26, 2026

  • Use Oj consistently for encoding and decoding.
  • Remove custom encoder in JSON initializer.
  • Configure Oj to encode BigDecimals as JSON numbers.
  • Override BigDecimal's as_json method; it's called by ActiveSupport and returns a string by default (before invoking the actual JSON encoder).
  • Adapt rescued error classes.
  • Add specs to test JSON encoding/decoding for service instance parameters (create, update, get) and service binding parameters (create, get).

Fixes #4799.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@philippthun philippthun force-pushed the json-decimal-encoding branch 2 times, most recently from a115685 to 3d75f7d Compare January 27, 2026 12:45
- Use Oj consistently for encoding and decoding.
- Remove custom encoder in JSON initializer.
- Configure Oj to encode BigDecimals as JSON numbers.
- Override BigDecimal's 'as_json' method; it's called by ActiveSupport
  and returns a string by default (before invoking the actual JSON
  encoder).
- Adapt rescued error classes.
- Add specs to test JSON encoding/decoding for service instance
  parameters (create, update, get) and service binding parameters
  (create, get).
Copy link
Contributor

@jochenehret jochenehret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on a dev bbl environment, works.

@philippthun philippthun merged commit 8b576d6 into cloudfoundry:main Feb 4, 2026
11 checks passed
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Feb 4, 2026
Changes in cloud_controller_ng:

- Don't JSON encode decimals as string
    PR: cloudfoundry/cloud_controller_ng#4807
    Author: Philipp Thun <philipp.thun@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloud Controller encodes JSON decimal numbers as strings when proxying service broker payloads

2 participants