Skip to content

Conversation

@aaa2000
Copy link
Contributor

@aaa2000 aaa2000 commented Nov 25, 2025

Q A
Branch? main
Tickets Closes #6934
License MIT

Render BCMath\Number (PHP 8.4+) as string instead of object

Before

{
    "@context": "/contexts/MathNumber",
    "@id": "/math_numbers/1",
    "@type": "MathNumber",
    "id": 1,
    "value": {
        "@id": "/.well-known/genid/d884d3a7bec8d1a52024",
        "@type": "Number",
        "scale": 2,
        "value": "300.55"
    }
}

After

{
    "@context": "/contexts/MathNumber",
    "@id": "/math_numbers/1",
    "@type": "MathNumber",
    "id": 1,
    "value": "300.55"
}

The symfony/serializer:7.3 added the NumberNormalizer, the symfony/framework-bundle:7.3 registered it.

In CI and the job PHPUnit (PHP 8.4), api-platform install symfony/framework-bundle:7.2

  - Locking symfony/framework-bundle (7.2.x-dev 42ac8bb)
  - Locking symfony/http-client (v7.3.6)
  - Locking symfony/http-client-contracts (v3.6.0)

if I try locally

composer require --dev "symfony/framework-bundle:7.3" -W --dry-run 
....
- symfony/object-mapper is locked to version 7.4.x-dev and an update of this package was not requested.
- symfony/framework-bundle v7.3.0 conflicts with symfony/object-mapper >=7.4.

@aaa2000 aaa2000 force-pushed the feat-6934-bcmath-number branch from a5e0533 to 0f95799 Compare November 25, 2025 18:09
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.

Render BCMath\Number (PHP 8.4+) as string instead of object

1 participant