Skip to content

feat(metadata): throwOnNotFound option#6027

Merged
soyuka merged 4 commits into
api-platform:mainfrom
soyuka:fix/6014
Jun 1, 2026
Merged

feat(metadata): throwOnNotFound option#6027
soyuka merged 4 commits into
api-platform:mainfrom
soyuka:fix/6014

Conversation

@soyuka

@soyuka soyuka commented Dec 7, 2023

Copy link
Copy Markdown
Member

fixes #6014

Needs test

@stale

stale Bot commented Feb 6, 2024

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Feb 6, 2024
@stale stale Bot closed this Feb 13, 2024
@soyuka soyuka reopened this Apr 30, 2024
@stale stale Bot removed the stale label Apr 30, 2024
soyuka added 2 commits June 1, 2026 10:50
Preserve legacy POST/PUT default in ReadProvider when option unset; remove
now-redundant override in MainController. Adds XSD attr, XML/YAML extractor
parsing, ResourceMetadataCompatibilityTest fixture + BASE entry,
XmlResourceAdapter ATTRIBUTES entry, and XmlExtractorTest/YamlExtractorTest
expectations. Six new ReadProviderTest cases cover explicit true/false and
default GET/POST/PUT/PUT+allowCreate paths.
Adds Feeder fixture with two Post operations (one throwOnNotFound: true, one
default) backed by a state provider that returns null. Verifies the explicit
option triggers a 404 (issue api-platform#6014) while default POST behavior remains
unchanged.
@soyuka soyuka marked this pull request as ready for review June 1, 2026 09:14
PHPStan flagged ?self as never returning self. Provider exists to
return null and trigger NotFound assertions, so narrowing to the
standalone null type satisfies the analyser without altering test
behavior.
@soyuka soyuka merged commit b2f1a5a into api-platform:main Jun 1, 2026
84 of 92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error 401 instead of 404 when doing a POST on a non-existent resource with a custom UriTemplate

1 participant