operationObject.json 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. {
  2. "id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/operationObject.json#",
  3. "$schema": "http://json-schema.org/draft-04/schema#",
  4. "type": "object",
  5. "allOf": [
  6. { "$ref": "dataTypeBase.json#" },
  7. {
  8. "required": [ "method", "nickname", "parameters" ],
  9. "properties": {
  10. "method": { "enum": [ "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS" ] },
  11. "summary": { "type": "string", "maxLength": 120 },
  12. "notes": { "type": "string" },
  13. "nickname": {
  14. "type": "string",
  15. "pattern": "^[a-zA-Z0-9_]+$"
  16. },
  17. "authorizations": {
  18. "type": "object",
  19. "additionalProperties": {
  20. "type": "array",
  21. "items": {
  22. "$ref": "authorizationObject.json#/definitions/oauth2Scope"
  23. }
  24. }
  25. },
  26. "parameters": {
  27. "type": "array",
  28. "items": { "$ref": "parameterObject.json#" }
  29. },
  30. "responseMessages": {
  31. "type": "array",
  32. "items": { "$ref": "#/definitions/responseMessageObject"}
  33. },
  34. "produces": { "$ref": "#/definitions/mimeTypeArray" },
  35. "consumes": { "$ref": "#/definitions/mimeTypeArray" },
  36. "deprecated": { "enum": [ "true", "false" ] }
  37. }
  38. }
  39. ],
  40. "definitions": {
  41. "responseMessageObject": {
  42. "type": "object",
  43. "required": [ "code", "message" ],
  44. "properties": {
  45. "code": { "$ref": "#/definitions/rfc2616section10" },
  46. "message": { "type": "string" },
  47. "responseModel": { "type": "string" }
  48. }
  49. },
  50. "rfc2616section10": {
  51. "type": "integer",
  52. "minimum": 100,
  53. "maximum": 600,
  54. "exclusiveMaximum": true
  55. },
  56. "mimeTypeArray": {
  57. "type": "array",
  58. "items": {
  59. "type": "string",
  60. "format": "mime-type"
  61. },
  62. "uniqueItems": true
  63. }
  64. }
  65. }