You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Feature-WIP] Rewiring to use controller middleware
For Laravel 5.3, it is necessary to use controller middleware
to run the validation of the HTTP request once for a specific
resource type.
This commit refactors the architecture so that:
1. JSON API suppprt is initiated and as HTTP content is parsed
for conformance to the spec. This happens in route middleware
and has no knowledge of what specific resource type is the
subject of the request. This process does content negotiation,
parses encoding parameters and parses document content checking
it conforms to the spec.
2. Other application middleware is now executed, knowing that
any exceptions thrown will be cast to JSON API errors.
3. The JSON API request is finalised with knowledge of what
resource type is expected. A JSON API request object is built
from all finalised parameters, and then this is validated
according to business logic. This is all done by a new piece
of middleware - `json-api-request` - that is registered as
controller middleware as that is the only point at which the
specific resource type is known, plus therefore the business
rules for validating request parameters and content.
Refer to issue #13
0 commit comments