composer-repository-schema.json 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. {
  2. "$schema": "https://json-schema.org/draft-04/schema#",
  3. "description": "A representation of packages metadata.",
  4. "type": "object",
  5. "oneOf": [
  6. { "required": [ "packages" ] },
  7. { "required": [ "providers" ] },
  8. { "required": [ "provider-includes", "providers-url" ] }
  9. ],
  10. "properties": {
  11. "packages": {
  12. "type": ["object", "array"],
  13. "description": "A hashmap of package names in the form of <vendor>/<name>.",
  14. "additionalProperties": { "$ref": "#/definitions/versions" }
  15. },
  16. "providers-url": {
  17. "type": "string",
  18. "description": "Endpoint to retrieve provider data from, e.g. '/p/%package%$%hash%.json'."
  19. },
  20. "provider-includes": {
  21. "type": "object",
  22. "description": "A hashmap of provider listings.",
  23. "additionalProperties": { "$ref": "#/definitions/provider" }
  24. },
  25. "providers": {
  26. "type": "object",
  27. "description": "A hashmap of package names in the form of <vendor>/<name>.",
  28. "additionalProperties": { "$ref": "#/definitions/provider" }
  29. },
  30. "notify-batch": {
  31. "type": "string",
  32. "description": "Endpoint to call after multiple packages have been installed, e.g. '/downloads/'."
  33. },
  34. "search": {
  35. "type": "string",
  36. "description": "Endpoint that provides search capabilities, e.g. '/search.json?q=%query%&type=%type%'."
  37. },
  38. "warning": {
  39. "type": "string",
  40. "description": "A message that will be output by Composer as a warning when this source is consulted."
  41. }
  42. },
  43. "definitions": {
  44. "versions": {
  45. "type": "object",
  46. "description": "A hashmap of versions and their metadata.",
  47. "additionalProperties": { "$ref": "#/definitions/version" }
  48. },
  49. "version": {
  50. "type": "object",
  51. "oneOf": [
  52. { "$ref": "#/definitions/package" },
  53. { "$ref": "#/definitions/metapackage" }
  54. ]
  55. },
  56. "package-base": {
  57. "properties": {
  58. "name": { "type": "string" },
  59. "type": { "type": "string" },
  60. "version": { "type": "string" },
  61. "version_normalized": {
  62. "type": "string",
  63. "description": "Normalized version, optional but can save computational time on client side."
  64. },
  65. "autoload": { "type": "object" },
  66. "require": { "type": "object" },
  67. "replace": { "type": "object" },
  68. "conflict": { "type": "object" },
  69. "provide": { "type": "object" },
  70. "time": { "type": "string" }
  71. },
  72. "additionalProperties": true
  73. },
  74. "package": {
  75. "allOf": [
  76. { "$ref": "#/definitions/package-base" },
  77. {
  78. "properties": {
  79. "dist": { "type": "object" },
  80. "source": { "type": "object" }
  81. }
  82. },
  83. { "oneOf": [
  84. { "required": [ "name", "version", "source" ] },
  85. { "required": [ "name", "version", "dist" ] }
  86. ] }
  87. ]
  88. },
  89. "metapackage": {
  90. "allOf": [
  91. { "$ref": "#/definitions/package-base" },
  92. {
  93. "properties": {
  94. "type": { "type": "string", "enum": [ "metapackage" ] }
  95. },
  96. "required": [ "name", "version", "type" ]
  97. }
  98. ]
  99. },
  100. "provider": {
  101. "type": "object",
  102. "properties": {
  103. "sha256": {
  104. "type": "string",
  105. "description": "Hash value that can be used to validate the resource."
  106. }
  107. }
  108. }
  109. }
  110. }