Issue with namespaced resource
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
The issue names no files, tests, or entry points. Start by tracing JSONAPI::Resources resource lookup for the shown namespaced STI models and reviewing how inherited resources are resolved. Done means determining whether the namespace and inheritance arrangement is supported, or documenting the required resource setup and reproducing the result.
Written by the indexing model from the issue text.
Description
I'm running into difficulty with STI models and their corresponding resources.
I have a base model Event, with subclasses Events::Applied, Events::Interview (amongst others) and I'm not sure how to set up the resources. Currently I have an Api::V1::EventResource and Api::V1::Events::AppliedResource and Api::V1::Events::InterviewResource (both of which subclass the EventResource, however I'm getting an error NameError (JSONAPI: Could not find resource 'events/applied'. (Class Events::AppliedResource not found)) - it appears that my base namespace Api::V1 isn't being taken into account?
I'm also not sure how to handle model inheritance as a whole when it comes to JSONAPI::Resources. I'd like to have the base resource for index actions (immutable) and the subclass resources for create/updates (as well as index/show). Does this fit the pattern correctly? I'm certainly open to suggestions.
- Dominant language
- Ruby
- Stars
- 2.3k
- Forks
- 546
- PR merge metrics
- No merged PRs in 30d
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.
More from JSONAPI-Resources/jsonapi-resources
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 3/5 1-2 days Newbie friendliness 50/100
JSONAPI-Resources/jsonapi-resources#1488 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
JSONAPI-Resources/jsonapi-resources#1479 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
JSONAPI-Resources/jsonapi-resources#1477 · 3 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
All issues in JSONAPI-Resources/jsonapi-resources
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ai-generated
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
hanami/hanami-cli#449 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
hanami/hanami-router#310 ·