schema.json 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {
  2. "$schema": "http://json-schema.org/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 or default project.",
  7. "properties": {
  8. "name": {
  9. "type": "string",
  10. "description": "The name of the new route guard.",
  11. "$default": {
  12. "$source": "argv",
  13. "index": 0
  14. },
  15. "x-prompt": "What name would you like to use for the guard?"
  16. },
  17. "spec": {
  18. "type": "boolean",
  19. "description": "When true (the default), generates a \"spec.ts\" test file for the new guard.",
  20. "default": true,
  21. "x-deprecated": "Use \"skipTests\" instead."
  22. },
  23. "skipTests": {
  24. "type": "boolean",
  25. "description": "When true, does not create \"spec.ts\" test files for the new guard.",
  26. "default": false,
  27. "x-user-analytics": 12
  28. },
  29. "flat": {
  30. "type": "boolean",
  31. "description": "When true (the default), creates the new files at the top level of the current project.",
  32. "default": true
  33. },
  34. "path": {
  35. "type": "string",
  36. "format": "path",
  37. "description": "The path at which to create the interface that defines the guard, relative to the current workspace.",
  38. "visible": false
  39. },
  40. "project": {
  41. "type": "string",
  42. "description": "The name of the project.",
  43. "$default": {
  44. "$source": "projectName"
  45. }
  46. },
  47. "lintFix": {
  48. "type": "boolean",
  49. "default": false,
  50. "description": "When true, applies lint fixes after generating the guard.",
  51. "x-user-analytics": 15
  52. },
  53. "implements": {
  54. "type": "array",
  55. "description": "Specifies which interfaces to implement.",
  56. "uniqueItems": true,
  57. "minItems": 1,
  58. "items": {
  59. "enum": [
  60. "CanActivate",
  61. "CanActivateChild",
  62. "CanDeactivate",
  63. "CanLoad"
  64. ],
  65. "type": "string"
  66. },
  67. "default": [
  68. "CanActivate"
  69. ],
  70. "x-prompt": "Which interfaces would you like to implement?"
  71. }
  72. },
  73. "required": [
  74. "name"
  75. ]
  76. }