keithwhor / nodal

API Services Made Easy With Node.js
http://www.nodaljs.com/
MIT License
4.51k stars 209 forks source link

Remove {id} from nodal g:model --user route edits #215

Closed nsipplswezey closed 8 years ago

nsipplswezey commented 8 years ago

nodal g:model --user generates a route with an id field that's unnecessary for basic access token usage. That is, tokens can be created and deleted without using an 'id' and most guides and tutorials reference access token operations without an id in the route. It makes sense to me to omit {id} from the generated route unless a default use cases is specified and covered in intro tutorials. Removal will increase consistency, and reduce cognitive load by generating simpler code with g:model --user generator.

Example of generated code in Nodal 0.0.9

router.route('/v1/tweets/{id}').use(V1TweetsController);
router.route('/v1/users/{id}').use(V1UsersController);
router.route('/v1/access_tokens/{id}').use(V1AccessTokensController);
keithwhor commented 8 years ago

Do you mean accessTokens? For user the show() and destroy() endpoints are important.

nsipplswezey commented 8 years ago

Oh of course! I meant the --access_tokens flag on g:model

Not --user. Thanks for catching.

Nick

On Apr 18, 2016, at 5:51 AM, Keith Horwood notifications@github.com wrote:

Do you mean accessTokens? For user the show() and destroy() endpoints are important.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub