schema.json 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema",
  3. "$id": "SchematicsAngularService",
  4. "title": "Angular Service Options Schema",
  5. "type": "object",
  6. "additionalProperties": false,
  7. "description": "Creates a new service in your project. Services are used to encapsulate reusable logic, such as data access, API calls, or utility functions. This schematic simplifies the process of generating a new service with the necessary files and boilerplate code.",
  8. "properties": {
  9. "name": {
  10. "type": "string",
  11. "description": "The name for the new service. This will be used to create the service's class and spec files (e.g., `my-service.service.ts` and `my-service.service.spec.ts`).",
  12. "$default": {
  13. "$source": "argv",
  14. "index": 0
  15. },
  16. "x-prompt": "What name would you like to use for the service?"
  17. },
  18. "path": {
  19. "type": "string",
  20. "$default": {
  21. "$source": "workingDirectory"
  22. },
  23. "description": "The path where the service files should be created, relative to the workspace root. If not provided, the service will be created in the project's `src/app` directory.",
  24. "visible": false
  25. },
  26. "project": {
  27. "type": "string",
  28. "description": "The name of the project where the service should be added. If not specified, the CLI will determine the project from the current directory.",
  29. "$default": {
  30. "$source": "projectName"
  31. }
  32. },
  33. "flat": {
  34. "type": "boolean",
  35. "default": true,
  36. "description": "Creates files at the top level of the project or the given path. If set to false, a new folder with the service's name will be created to contain the files."
  37. },
  38. "skipTests": {
  39. "type": "boolean",
  40. "description": "Skip the generation of a unit test file `spec.ts` for the service.",
  41. "default": false
  42. }
  43. },
  44. "required": ["name", "project"]
  45. }