schema-form-core.yaml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. openapi: 3.0.0
  2. info:
  3. title: "Schema in Parameters"
  4. description: |-
  5. This document has examples for examining the `schema` within a set of parameters
  6. * String Enum (/pet/findByStatus)
  7. * Array of Strings (/pet/findByTags)
  8. * Array of Boolean (/petOwner/listOfServiceTrainer)
  9. * Array of Objects (/petOwners/createWithList)
  10. * Array of Enum (/petOwner/findByPreference)
  11. This document also covers a debounce test for `schema` type `string
  12. * String (/petOwner)
  13. This documents does not cover:
  14. * Array of Arrays
  15. Additional notes
  16. * Provides additional coverage and examples not covered in the Multiple Examples Core Document (Test)
  17. * Code component reference `JsonSchemaForm`
  18. * `pet` and `tag` schemas are reduced from Swagger Petstore
  19. version: "1.0.0"
  20. paths:
  21. /pet/findByStatus:
  22. get:
  23. summary: Finds Pets by status
  24. description: Multiple status values can be provided with comma separated strings
  25. operationId: findPetsByStatus
  26. parameters:
  27. - name: status
  28. in: query
  29. description: Status values that need to be considered for filter
  30. required: false
  31. explode: true
  32. schema:
  33. type: string
  34. enum:
  35. - available
  36. - pending
  37. - sold
  38. default: available
  39. responses:
  40. '200':
  41. description: successful operation
  42. content:
  43. application/xml:
  44. schema:
  45. type: array
  46. items:
  47. $ref: '#/components/schemas/Pet'
  48. application/json:
  49. schema:
  50. type: array
  51. items:
  52. $ref: '#/components/schemas/Pet'
  53. '400':
  54. description: Invalid status value
  55. security:
  56. - petstore_auth:
  57. - 'write:pets'
  58. - 'read:pets'
  59. /pet/findByTags:
  60. get:
  61. tags:
  62. - pet
  63. summary: Finds Pets by tags
  64. description: >-
  65. Multiple tags can be provided with comma separated strings. Use tag1,
  66. tag2, tag3 for testing.
  67. operationId: findPetsByTags
  68. parameters:
  69. - name: tags
  70. in: query
  71. description: Tags to filter by
  72. required: false
  73. explode: true
  74. schema:
  75. type: array
  76. items:
  77. type: string
  78. responses:
  79. '200':
  80. description: successful operation
  81. content:
  82. application/xml:
  83. schema:
  84. type: array
  85. items:
  86. $ref: '#/components/schemas/Pet'
  87. application/json:
  88. schema:
  89. type: array
  90. items:
  91. $ref: '#/components/schemas/Pet'
  92. '400':
  93. description: Invalid tag value
  94. security:
  95. - petstore_auth:
  96. - 'write:pets'
  97. - 'read:pets'
  98. '/petOwner/{petOwnerId}':
  99. get:
  100. tags:
  101. - petOwner
  102. summary: Find pet owner by ID
  103. description: Returns a single pet owner if ID found, list if no ID provided
  104. operationId: getPetOwnerById
  105. parameters:
  106. - name: petOwnerId
  107. in: path
  108. description: ID of pet owner to return
  109. required: false
  110. schema:
  111. type: integer
  112. format: int64
  113. responses:
  114. '200':
  115. description: successful operation
  116. content:
  117. application/xml:
  118. schema:
  119. $ref: '#/components/schemas/PetOwner'
  120. application/json:
  121. schema:
  122. $ref: '#/components/schemas/PetOwner'
  123. '400':
  124. description: Invalid ID supplied
  125. '404':
  126. description: Pet not found
  127. /petOwner/listOfServiceTrainer:
  128. get:
  129. tags:
  130. - petOwner
  131. summary: List of Service Trainers
  132. description: >-
  133. Expect boolean, but allow both true and false
  134. operationId: listOfServiceTrainer
  135. parameters:
  136. - name: tags
  137. in: query
  138. description: Boolean to filter by
  139. required: false
  140. explode: true
  141. schema:
  142. type: array
  143. items:
  144. type: boolean
  145. responses:
  146. '200':
  147. description: successful operation
  148. content:
  149. application/xml:
  150. schema:
  151. type: array
  152. items:
  153. $ref: '#/components/schemas/PetOwner'
  154. application/json:
  155. schema:
  156. type: array
  157. items:
  158. $ref: '#/components/schemas/PetOwner'
  159. '400':
  160. description: Invalid tag value
  161. /petOwner/findByPreference:
  162. get:
  163. tags:
  164. - petOwner
  165. summary: Find by Pet Owner Preferences
  166. description: >-
  167. Expect enum
  168. operationId: findByPreference
  169. parameters:
  170. - name: tags
  171. in: query
  172. description: Enum to filter by
  173. required: false
  174. explode: true
  175. schema:
  176. type: array
  177. items:
  178. type: string
  179. enum:
  180. - dog
  181. - cat
  182. - bird
  183. - fish
  184. - other
  185. default: dog
  186. responses:
  187. '200':
  188. description: successful operation
  189. content:
  190. application/xml:
  191. schema:
  192. type: array
  193. items:
  194. $ref: '#/components/schemas/PetOwner'
  195. application/json:
  196. schema:
  197. type: array
  198. items:
  199. $ref: '#/components/schemas/PetOwner'
  200. '400':
  201. description: Invalid tag value
  202. components:
  203. /petOwner/createWithList:
  204. post:
  205. tags:
  206. - petOwner
  207. summary: Creates list of pet owners with given input array
  208. operationId: petOwnerCreateWithList
  209. requestBody:
  210. content:
  211. application/json:
  212. schema:
  213. type: array
  214. items:
  215. $ref: '#/components/schemas/PetOwner'
  216. responses:
  217. '200':
  218. description: successful operation
  219. content:
  220. application/xml:
  221. schema:
  222. type: array
  223. items:
  224. $ref: '#/components/schemas/PetOwner'
  225. application/json:
  226. schema:
  227. type: array
  228. items:
  229. $ref: '#/components/schemas/PetOwner'
  230. '400':
  231. description: Invalid values
  232. schemas:
  233. Pet:
  234. x-swagger-router-model: io.swagger.petstore.model.Pet
  235. required:
  236. - name
  237. - photoUrls
  238. properties:
  239. id:
  240. type: integer
  241. format: int64
  242. example: 10
  243. name:
  244. type: string
  245. example: doggie
  246. # remove category property
  247. petOwners:
  248. type: array
  249. items:
  250. $ref: '#/components/schemas/PetOwner'
  251. photoUrls:
  252. type: array
  253. xml:
  254. wrapped: true
  255. items:
  256. type: string
  257. xml:
  258. name: photoUrl
  259. tags:
  260. type: array
  261. xml:
  262. wrapped: true
  263. items:
  264. $ref: '#/components/schemas/Tag'
  265. xml:
  266. name: tag
  267. status:
  268. type: string
  269. description: pet status in the store
  270. enum:
  271. - available
  272. - pending
  273. - sold
  274. xml:
  275. name: pet
  276. type: object
  277. # remove ApiResponse
  278. PetOwner:
  279. type: "object"
  280. properties:
  281. id:
  282. type: "integer"
  283. format: "int64"
  284. example: 10
  285. petId:
  286. type: "integer"
  287. format: "int64"
  288. example: 201
  289. petOwnerFirstName:
  290. type: "string"
  291. example: "John"
  292. petOwnerLastName:
  293. type: "string"
  294. example: "Smith"
  295. petOwnerContact:
  296. type: "string"
  297. example: "john.smith@fakeemail.co"
  298. petOwnerStatus:
  299. type: "integer"
  300. format: "int32"
  301. description: "Pet Owner Status"
  302. example: 302
  303. petOwnerPreferences:
  304. type: "string"
  305. description: "Pet Owner Preferred Pet Types"
  306. enum:
  307. - "dog"
  308. - "cat"
  309. - "bird"
  310. - "fish"
  311. - "other"
  312. petOwnerServiceTrainer:
  313. type: "boolean"
  314. description: "Pet Onwer is Service Trainer"
  315. default: false
  316. Tag:
  317. x-swagger-router-model: io.swagger.petstore.model.Tag
  318. properties:
  319. id:
  320. type: integer
  321. format: int64
  322. name:
  323. type: string
  324. xml:
  325. name: tag
  326. type: object
  327. requestBodies:
  328. Pet:
  329. content:
  330. application/json:
  331. schema:
  332. $ref: '#/components/schemas/Pet'
  333. application/xml:
  334. schema:
  335. $ref: '#/components/schemas/Pet'
  336. description: Pet object that needs to be added to the store