[1.x] Add Empty Response & Error Bag Handling#39
Open
adrum wants to merge 21 commits intokapi2289:v1from
Open
Conversation
# Conflicts: # InertiaCore/Extensions/Configure.cs # InertiaCore/Inertia.cs # InertiaCore/ResponseFactory.cs # InertiaCore/Utils/BackResult.cs # InertiaCoreTests/UnitTestBack.cs
Contributor
Author
|
@kapi2289 Good to go! We needed to keep the status code option. |
Cover the subtle Laravel-parity cases in ResolveValidationErrors, including default-bag re-labeling when X-Inertia-Error-Bag is set, multi-bag fallback, and the ModelState-only fallback path. No behavior change — tests protect existing correctness.
Drop the Count == 1 guard in ResolveValidationErrors so that when TempData contains a default bag alongside other named bags (with no X-Inertia-Error-Bag header), the default bag's errors are returned unwrapped. Previously, multi-bag responses would fall through to returning all bags, producing a nested shape the Inertia.js frontend would not match against its flat errors expectation. Mirrors Laravel's Middleware::resolveValidationErrors pipe which returns the default bag unconditionally when present.
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 finishes #28 and should be merged after #38