apiDeclaration.json 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {
  2. "id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/apiDeclaration.json#",
  3. "$schema": "http://json-schema.org/draft-04/schema#",
  4. "type": "object",
  5. "required": [ "swaggerVersion", "basePath", "apis" ],
  6. "properties": {
  7. "swaggerVersion": { "enum": [ "1.2" ] },
  8. "apiVersion": { "type": "string" },
  9. "basePath": {
  10. "type": "string",
  11. "format": "uri",
  12. "pattern": "^https?://"
  13. },
  14. "resourcePath": {
  15. "type": "string",
  16. "format": "uri",
  17. "pattern": "^/"
  18. },
  19. "apis": {
  20. "type": "array",
  21. "items": { "$ref": "#/definitions/apiObject" }
  22. },
  23. "models": {
  24. "type": "object",
  25. "additionalProperties": {
  26. "$ref": "modelsObject.json#"
  27. }
  28. },
  29. "produces": { "$ref": "#/definitions/mimeTypeArray" },
  30. "consumes": { "$ref": "#/definitions/mimeTypeArray" },
  31. "authorizations": { "$ref": "authorizationObject.json#" }
  32. },
  33. "additionalProperties": false,
  34. "definitions": {
  35. "apiObject": {
  36. "type": "object",
  37. "required": [ "path", "operations" ],
  38. "properties": {
  39. "path": {
  40. "type": "string",
  41. "format": "uri-template",
  42. "pattern": "^/"
  43. },
  44. "description": { "type": "string" },
  45. "operations": {
  46. "type": "array",
  47. "items": { "$ref": "operationObject.json#" }
  48. }
  49. },
  50. "additionalProperties": false
  51. },
  52. "mimeTypeArray": {
  53. "type": "array",
  54. "items": {
  55. "type": "string",
  56. "format": "mime-type"
  57. },
  58. "uniqueItems": true
  59. }
  60. }
  61. }