[fix] name mapping in request data classes#226
Merged
jbrooksuk merged 2 commits intocachethq:mainfrom Jan 28, 2025
joelbutcher:fix/data-snake-case
Merged
[fix] name mapping in request data classes#226jbrooksuk merged 2 commits intocachethq:mainfrom joelbutcher:fix/data-snake-case
jbrooksuk merged 2 commits intocachethq:mainfrom
joelbutcher:fix/data-snake-case
Conversation
Contributor
|
thanks for the fix @joelbutcher 👍 |
jbrooksuk
added a commit
that referenced
this pull request
Feb 10, 2025
* main: (103 commits) Update PHPStan parameters Change schedule running Fix dutch translations (#231) fix: remove additional prompt for name (#227) [fix] name mapping in request data classes (#226) fix: define getTitle method on Settings pages to use localised name (#224) Set OG images Fix code styling Demo Mode (#223) Fix code styling fix: make user command does not accept a name argument (#216) Apply ordering of component groups to status page Use root language for local dialects Compile Assets Updated PH localization (#213) Bump vite from 5.4.8 to 5.4.14 (#214) Fix code styling Support the `HTTP_REMOTE_USER` header (#208) New adjustments added for German translation and added Dutch (#209) Fix code styling ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a snake case name mapper PHP attribute to
BaseData.closes #225
Problem Context
As discovered in #225, the API tests are returning a false positive, because of the Laravel Data configuration used for testbench:
Setting both of these values to
NULLand running the test suite highlights the error. Of course, this is fine in our tests as we are specifying the Laravel app to uses these mappers. However applications consuming this package might not have Laravel Data configured this way.The fix
Since we have architectural tests in place to ensure that all
XyzRequestDataclasses must be declaredfinaland must extendBaseData, we are able to fix the problem by simply adding the following attribute above the class declaration forBaseData: