Commit 0523300
committed
bug #54146 [HttpClient] Preserve float in JsonMockResponse (Jibbarth)
This PR was merged into the 6.4 branch.
Discussion
----------
[HttpClient] Preserve float in JsonMockResponse
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License | MIT
Hello,
I am mocking an API Response that can send float in values :
```
{
"values": 1.0
}
```
Converting this to a php array and giving it to JsonMockResponse return me an int after, because the missing json_encode flag to keep zero fraction, and leds to issue when I want to deserialize it into a float property.
In my mind it's a bugfix, but if it's considered as a new feature, I can target 7.1.
Commits
-------
4d120b8 [HttpClient] Preserve float in JsonMockResponse2 files changed
Lines changed: 17 additions & 1 deletion
File tree
- src/Symfony/Component/HttpClient
- Response
- Tests/Response
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
62 | 78 | | |
63 | 79 | | |
64 | 80 | | |
| |||
0 commit comments