Public API for Resource behavior metadata #14
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
#3 Ability to declare HTTP resources
slendium/framework
#10 Declarable HTTP resources
slendium/framework
Reference
slendium/framework#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently the actual behavior of a
Resourceis inaccessible from outside of theHandlerblack box. It is not possible to:While it would be possible to use reflection on the
Resourceclass to obtain this information, this would only show the information as declared and not how it actually behaves. For example, every resource has impliedHEADandOPTIONSmethods and every parameter has an impliedFromQueryextractor. Future versions may further introduce new implied, edge-case, documentation, or security-related behavior.There should be a public API that standardizes this "behavioral metadata" about resources. Implementing OpenAPI would be impossible otherwise. The
Handleritself should also be refactored to use these API's instead of its own internal methods, to keep the metadata in sync with the actual behavior.Suggestion: a final class
Resource\Endpointand a namespace with the same name that contains all the helpers (Resource\Endpoint\{ Method, Parameter, StringParameter, ... }.Merging this with #3.