JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources
Custom Operations
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2.3k
- Forks
- 546
- PR merge metrics
- No merged PRs in 30d
Description
As per discussed in #129, I would like to do other tasks within a CRUD operation.
For my specific use case, I would like to create related resources upon creating a parent resource. The API is still strictly CRUD and compliant with JSONAPI, but under the hood I would like to have business logic that lives on the server side rather than the client. I found that decoupling this sort of code into service objects have been great for testing and maintainability, and it looks like Operation is exactly that.
Perhaps we can refactor it such that users of this gem can write their own operations for specific resources?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the discussion in #129 and the existing Operation abstraction to understand how CRUD requests are currently handled. Define what an extension point for resource-specific operations would need to support, including creating related resources while keeping the external API CRUD-based and JSON:API-compliant; completion should include a maintainable service-object approach and evidence that the behavior is testable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100