schema.json 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema",
  3. "$id": "SchematicsAngularGuard",
  4. "title": "Angular Guard Options Schema",
  5. "type": "object",
  6. "description": "Generates a new, generic route guard definition in the given project.",
  7. "additionalProperties": false,
  8. "properties": {
  9. "name": {
  10. "type": "string",
  11. "description": "The name of the new route guard.",
  12. "$default": {
  13. "$source": "argv",
  14. "index": 0
  15. },
  16. "x-prompt": "What name would you like to use for the guard?"
  17. },
  18. "skipTests": {
  19. "type": "boolean",
  20. "description": "Do not create \"spec.ts\" test files for the new guard.",
  21. "default": false
  22. },
  23. "flat": {
  24. "type": "boolean",
  25. "description": "When true (the default), creates the new files at the top level of the current project.",
  26. "default": true
  27. },
  28. "path": {
  29. "type": "string",
  30. "format": "path",
  31. "$default": {
  32. "$source": "workingDirectory"
  33. },
  34. "description": "The path at which to create the interface that defines the guard, relative to the current workspace.",
  35. "visible": false
  36. },
  37. "project": {
  38. "type": "string",
  39. "description": "The name of the project.",
  40. "$default": {
  41. "$source": "projectName"
  42. }
  43. },
  44. "functional": {
  45. "type": "boolean",
  46. "description": "Specifies whether to generate a guard as a function.",
  47. "default": true
  48. },
  49. "implements": {
  50. "alias": "guardType",
  51. "type": "array",
  52. "description": "Specifies which type of guard to create.",
  53. "uniqueItems": true,
  54. "minItems": 1,
  55. "items": {
  56. "enum": ["CanActivate", "CanActivateChild", "CanDeactivate", "CanMatch"],
  57. "type": "string"
  58. },
  59. "default": ["CanActivate"],
  60. "x-prompt": "Which type of guard would you like to create?"
  61. }
  62. },
  63. "required": ["name", "project"]
  64. }