api-platform / core

The server component of API Platform: hypermedia and GraphQL APIs in minutes
https://api-platform.com
MIT License
2.45k stars 877 forks source link

fix(laravel): snake case props #6532

Closed dunglas closed 2 months ago

dunglas commented 2 months ago
Q A
Branch? main
Tickets n/a
License MIT
Doc PR n/a

Currently, model properties containing an underscore aren't written or read because an unneeded case conversion occurs. This patch fixes the issue.

A better fix could be to always convert internal snake_case model props to public camelCase API resources props. Now implemented in this PR.

soyuka commented 2 months ago

Is it possible to add a property to test this at src/Laravel/workbench/app/Models/Book.php ?