composer-repository-schema.json 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {
  2. "$schema": "http://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-generic" },
  53. { "$ref": "#/definitions/package-metapackage" }
  54. ]
  55. },
  56. "package-generic": {
  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. "source": { "type": "object" },
  66. "dist": { "type": "object" },
  67. "time": { "type": "string" }
  68. },
  69. "oneOf": [
  70. { "required": [ "name", "version", "source" ] },
  71. { "required": [ "name", "version", "dist" ] }
  72. ],
  73. "additionalProperties": true
  74. },
  75. "package-metapackage": {
  76. "properties": {
  77. "name": { "type": "string" },
  78. "type": { "type": "string", "enum": [ "metapackage" ] },
  79. "version": { "type": "string" },
  80. "version_normalized": {
  81. "type": "string",
  82. "description": "Normalized version, optional but can save computational time on client side."
  83. },
  84. "time": { "type": "string" }
  85. },
  86. "required": [ "name", "version" ],
  87. "additionalProperties": true
  88. },
  89. "provider": {
  90. "type": "object",
  91. "properties": {
  92. "sha256": {
  93. "type": "string",
  94. "description": "Hash value that can be used to validate the resource."
  95. }
  96. }
  97. }
  98. }
  99. }