schema-form-enum-boolean.yaml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. swagger: "2.0"
  2. info:
  3. description: "Test Required Enum and Boolean with Execute"
  4. version: "1.0.0"
  5. title: "Swagger Petstore"
  6. termsOfService: "http://swagger.io/terms/"
  7. contact:
  8. email: "apiteam@swagger.io"
  9. license:
  10. name: "Apache 2.0"
  11. url: "http://www.apache.org/licenses/LICENSE-2.0.html"
  12. host: "petstore.swagger.io"
  13. basePath: "/v2"
  14. tags:
  15. - name: "pet"
  16. description: "Everything about your Pets"
  17. externalDocs:
  18. description: "Find out more"
  19. url: "http://swagger.io"
  20. schemes:
  21. - "https"
  22. - "http"
  23. paths:
  24. /pet/findByStatus:
  25. get:
  26. tags:
  27. - "pet"
  28. summary: "Finds Pets by status"
  29. description: "Multiple status values can be provided with comma separated strings"
  30. operationId: "findPetsByStatus"
  31. produces:
  32. - "application/xml"
  33. - "application/json"
  34. parameters:
  35. - name: "status"
  36. in: "query"
  37. description: "Status values that need to be considered for filter"
  38. required: true
  39. type: "array"
  40. items:
  41. type: "string"
  42. enum:
  43. - "available"
  44. - "pending"
  45. - "sold"
  46. default: "available"
  47. collectionFormat: "multi"
  48. - name: "expectIsOptional"
  49. in: "query"
  50. description: "this field should be optional"
  51. required: false
  52. type: boolean
  53. - name: "expectIsRequired"
  54. in: "query"
  55. description: "this field should be required"
  56. required: true
  57. type: boolean
  58. responses:
  59. "200":
  60. description: "successful operation"
  61. schema:
  62. type: "array"
  63. items:
  64. $ref: "#/definitions/Pet"
  65. "400":
  66. description: "Invalid status value"
  67. definitions:
  68. Pet:
  69. type: "object"
  70. required:
  71. - "name"
  72. properties:
  73. id:
  74. type: "integer"
  75. format: "int64"
  76. name:
  77. type: "string"
  78. example: "doggie"
  79. status:
  80. type: "string"
  81. description: "pet status in the store"
  82. enum:
  83. - "available"
  84. - "pending"
  85. - "sold"
  86. xml:
  87. name: "Pet"