JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

Add full scaffold generator support

Open
#1,265 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
2.3k
Forks
546
PR merge metrics
No merged PRs in 30d

Description

This issue is a (choose one):

  • Feature request.

Checklist before submitting:

  • I've searched for an existing issue.
  • The feature I'm asking for is compliant with the JSON:API spec.

Description

Features:

note: this issue (or something similar to it) was brought up by @eccegordo in https://github.com/cerebris/jsonapi-resources/issues/1241. I opened this issue because I did not want to automatically close his in case our requests diverged, but will follow up with that issue if this issue is resolved with my PR.

As a developer, I need to be able to spin up new services, collect feedback, and validate those proofs-of-concepts as quickly as possible. Any time I spend writing boilerplate code is time not spent working on real value-adding features or concepts.

As such, I would like a way to quickly, consistently, and safely generate all of the required base file structures to get a jsonapi resource/endpoint working. Further, I would like these generated files to be opinionated, and help me fall into a "pit of success" / good practices.

In scope:

  • generate (flat or name-spaced) base controllers
  • generate (flat or name-spaced) controllers
  • generate (flat or name-spaced) base resources
  • generate (flat or name-spaced) resources
  • generate (flat or name-spaced) base models
  • generate (flat or name-spaced) models
  • generate (flat or name-spaced) routes

Out of scope:

  • declare attributes, associations, or other defining characteristics during generation
  • parameterized generation options (e.g. "don't generate base classes")
  • generate (flat or name-spaced) tests (future PR)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by mapping the repository's existing generator entry points and conventions against the in-scope list: controllers, resources, models, and routes, each with flat and namespaced forms. Done means generating the requested base and concrete files consistently, while leaving attributes, associations, parameterized options, and tests out of scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
api, backend, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.