{{ message }}
Repository navigation
docs(operations): throwOnNotFound + dynamic status - #2327
Merged
Merged
Conversation
Document two 4.4 operation-level features that shipped without docs: - `throwOnNotFound` (core#6027): controls whether ReadProvider throws 404 on null data, cross-referenced with `allowCreate` on PUT. - dynamic response status via the `_api_response_status` request attribute (core#7904), read by HttpResponseStatusTrait ahead of the static `status` operation option. Verified against api-platform/core src/State/Provider/ReadProvider.php and src/State/Util/HttpResponseStatusTrait.php at upstream/4.4.
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.

Summary
Documents two 4.4 operation-level features that shipped without any docs (audit rows F20/F23):
throwOnNotFound(feat(metadata): throwOnNotFound option core#6027) — controls whether theReadProviderthrows a404 Not Foundwhen the provider returnsnull. Verified the actual default logic insrc/State/Provider/ReadProvider.php:91-103(upstream/4.4): by default a404is thrown unless the method isPOST, or the operation is aPUTwithallowCreateenabled. Cross-referenced with the existing "Upsert: Creating a Resource With PUT" section rather than restatingallowCreate._api_response_statusrequest attribute (feat: support dynamic HTTP response status code via request attribute core#7904) — read insrc/State/Util/HttpResponseStatusTrait.php:40-41, consumed byRespondProcessor. It takes precedence over the operation's staticstatusoption. Documented as the escape hatch for a status that depends on runtime processor logic, with a worked custom-processor example, and an explicit note that the staticstatusoption remains the right tool for a fixed-per-operation code.Both features exist as-is in 4.4 and flow to 5.0 via merge-up; written in plain present tense with an "Available since API Platform 4.4." note, matching the convention already used in
core/performance.md.Scope
Only
core/operations.mdtouched. No new page, sooutline.yamlis unchanged.Test plan
throwOnNotFounddefault logic by readingReadProvider::provide()atupstream/4.4_api_response_statusattribute name and precedence by readingHttpResponseStatusTrait::getStatus()andRespondProcessor::process()atupstream/4.4npx prettier@3.9.5 --check "**/*.md" --prose-wrap alwayspasses repo-wide