nestia icon indicating copy to clipboard operation
nestia copied to clipboard

Support different nesting strategy

Open SkyaTura opened this issue 1 year ago • 0 comments

It would be nice to have an option to use the name of the controller (and/or, possibly, modules, if nested as well) to generate the SDK nested output, rather than using the Paths.

Example

  • App
    • User.module
      • UserAccount.controller (/users/accounts)
        • list (GET /)
        • create (POST /)
        • update (PUT /:id)
        • remove (DELETE /:id)
      • UserProfile.controller (/users/profiles)
        • getMine (GET /mine)
        • updateMine (PUT /mine)
        • search (POST /public)
        • getById (GET /public/:id)
        • follow (POST /public/:id/follow)
        • unfollow (POST /public/:id/unfollow)
    • Post.controller (/posts)
      • getMine (GET /mine)
      • findByTag (POST /tags)
      • create (POST /)
      • getById (GET /:id)

Expected output

  • SDK
    • user
      • account (defined by the controller name, not the path)
        • list
        • create
        • remove
        • update
      • profile
        • getMine
        • updateMine
        • search
        • follow
        • unfollow
    • post
      • create
      • getMine
      • findByTag
      • getById

SkyaTura avatar Aug 16 '22 02:08 SkyaTura