RestController: when no specific classAlias is set, use automatic alias from xPDO #16395
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.
What does it do?
In the modRestController, change the classAlias fallback to the alias that gets autogenerated by xPDO.
Why is it needed?
With namespaced model classes, the full classKey becomes invalid for aliases, and you'd really want that to use the clean short version.
How to test
In a rest controller without a specific classAlias, confirm you can get data.
Related issue(s)/PR(s)
This was recently reported via Slack and the fix confirmed by the reporter.
I'm personally on the fence as to whether this is a 3.0.x bugfix or a 3.1 improved behavior but would suggest 3.1.