-
Notifications
You must be signed in to change notification settings - Fork 13
Labels
@h3ravel/httpAPIbackendenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededonlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekContribute to awesome OSS repos during OnlyDust's open source week
Description
Background: Standardize API responses with Resources (single model) and Collections (lists + pagination + meta).
Tasks:
- Your core implementation will live in the
@h3ravel/httppackage directory. - Create
Resourcebase class (toArray, with/without relationships). - Create
Collectionbase class supporting pagination, meta, links. - Integrate with response helpers to automatically detect Resource/Collection and set JSON structure.
- Provide helpers for transforming Arquebus models and relations.
- Add tests demonstrating Resource and Collection usage (single resource, collection paginated).
- Add example usage docs in http documentation.
Acceptance criteria:
- Returning a
Resourcefrom a controller yields{ data: { ... } }. - Returning a
Collectionyields{ data: [...], meta: {...}, links: {...} }. - Tests cover transformations and pagination meta generation.
- Interface mirrors laravel as much as possible, creating the familiar DX while also adding it own unique twists and turns.
Difficulty: medium
Metadata
Metadata
Assignees
Labels
@h3ravel/httpAPIbackendenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededonlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekContribute to awesome OSS repos during OnlyDust's open source week