Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[CLI] Prompt for plural of model for REST Controller generation #887

Closed
4 tasks
kjdelisle opened this issue Jan 22, 2018 · 0 comments · Fixed by #1314
Closed
4 tasks

[CLI] Prompt for plural of model for REST Controller generation #887

kjdelisle opened this issue Jan 22, 2018 · 0 comments · Fixed by #1314
Assignees
Labels
Milestone

Comments

@kjdelisle
Copy link
Contributor

kjdelisle commented Jan 22, 2018

Overview

As a LoopBack 4 user, I would like the routes generated in my controllers to follow the practice used in LoopBack 3, where my REST resource routes were plural versions of my model name (Foo -> /foos)

Acceptance Criteria

  • Add a new prompt to the REST controller template that
    • Prompts for plural name and provides a sane default in the same way LoopBack 3 does (change the name to plural, convert from camel-case to kebab case, i.e. UsedCar to used-cars)
    • Allows editing of the value to whatever is preferred by the developer
    • Validate plural form is URL Safe (same as Model Name validation used today in LB4)
  • Add test coverage
  • Change JSDocs to explain the new feature (and flag)
  • Update loopback.io documentation
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants