schema.yaml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913
  1. $id: 'https://spec.openapis.org/oas/3.1/schema/2021-04-15'
  2. $schema: 'https://json-schema.org/draft/2020-12/schema'
  3. type: object
  4. properties:
  5. openapi:
  6. type: string
  7. pattern: '^3\.1\.\d+(-.+)?$'
  8. info:
  9. $ref: '#/$defs/info'
  10. jsonSchemaDialect:
  11. $ref: '#/$defs/uri'
  12. default: 'https://spec.openapis.org/oas/3.1/dialect/base'
  13. servers:
  14. type: array
  15. items:
  16. $ref: '#/$defs/server'
  17. paths:
  18. $ref: '#/$defs/paths'
  19. webhooks:
  20. type: object
  21. additionalProperties:
  22. $ref: '#/$defs/path-item-or-reference'
  23. components:
  24. $ref: '#/$defs/components'
  25. security:
  26. type: array
  27. items:
  28. $ref: '#/$defs/security-requirement'
  29. tags:
  30. type: array
  31. items:
  32. $ref: '#/$defs/tag'
  33. externalDocs:
  34. $ref: '#/$defs/external-documentation'
  35. required:
  36. - openapi
  37. - info
  38. anyOf:
  39. - required:
  40. - paths
  41. - required:
  42. - components
  43. - required:
  44. - webhooks
  45. $ref: '#/$defs/specification-extensions'
  46. unevaluatedProperties: false
  47. $defs:
  48. info:
  49. type: object
  50. properties:
  51. title:
  52. type: string
  53. summary:
  54. type: string
  55. description:
  56. type: string
  57. termsOfService:
  58. type: string
  59. contact:
  60. $ref: '#/$defs/contact'
  61. license:
  62. $ref: '#/$defs/license'
  63. version:
  64. type: string
  65. required:
  66. - title
  67. - version
  68. $ref: '#/$defs/specification-extensions'
  69. unevaluatedProperties: false
  70. contact:
  71. type: object
  72. properties:
  73. name:
  74. type: string
  75. url:
  76. type: string
  77. email:
  78. type: string
  79. $ref: '#/$defs/specification-extensions'
  80. unevaluatedProperties: false
  81. license:
  82. type: object
  83. properties:
  84. name:
  85. type: string
  86. identifier:
  87. type: string
  88. url:
  89. $ref: '#/$defs/uri'
  90. required:
  91. - name
  92. oneOf:
  93. - required:
  94. - identifier
  95. - required:
  96. - url
  97. $ref: '#/$defs/specification-extensions'
  98. unevaluatedProperties: false
  99. server:
  100. type: object
  101. properties:
  102. url:
  103. $ref: '#/$defs/uri'
  104. description:
  105. type: string
  106. variables:
  107. type: object
  108. additionalProperties:
  109. $ref: '#/$defs/server-variable'
  110. required:
  111. - url
  112. $ref: '#/$defs/specification-extensions'
  113. unevaluatedProperties: false
  114. server-variable:
  115. type: object
  116. properties:
  117. enum:
  118. type: array
  119. items:
  120. type: string
  121. minItems: 1
  122. default:
  123. type: string
  124. descriptions:
  125. type: string
  126. required:
  127. - default
  128. $ref: '#/$defs/specification-extensions'
  129. unevaluatedProperties: false
  130. components:
  131. type: object
  132. properties:
  133. schemas:
  134. type: object
  135. additionalProperties:
  136. $dynamicRef: '#meta'
  137. responses:
  138. type: object
  139. additionalProperties:
  140. $ref: '#/$defs/response-or-reference'
  141. parameters:
  142. type: object
  143. additionalProperties:
  144. $ref: '#/$defs/parameter-or-reference'
  145. examples:
  146. type: object
  147. additionalProperties:
  148. $ref: '#/$defs/example-or-reference'
  149. requestBodies:
  150. type: object
  151. additionalProperties:
  152. $ref: '#/$defs/request-body-or-reference'
  153. headers:
  154. type: object
  155. additionalProperties:
  156. $ref: '#/$defs/header-or-reference'
  157. securitySchemes:
  158. type: object
  159. additionalProperties:
  160. $ref: '#/$defs/security-scheme-or-reference'
  161. links:
  162. type: object
  163. additionalProperties:
  164. $ref: '#/$defs/link-or-reference'
  165. callbacks:
  166. type: object
  167. additionalProperties:
  168. $ref: '#/$defs/callbacks-or-reference'
  169. pathItems:
  170. type: object
  171. additionalProperties:
  172. $ref: '#/$defs/path-item-or-reference'
  173. patternProperties:
  174. '^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$':
  175. $comment: Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected
  176. propertyNames:
  177. pattern: '^[a-zA-Z0-9._-]+$'
  178. $ref: '#/$defs/specification-extensions'
  179. unevaluatedProperties: false
  180. paths:
  181. type: object
  182. patternProperties:
  183. '^/':
  184. $ref: '#/$defs/path-item'
  185. $ref: '#/$defs/specification-extensions'
  186. unevaluatedProperties: false
  187. path-item:
  188. type: object
  189. properties:
  190. summary:
  191. type: string
  192. description:
  193. type: string
  194. servers:
  195. type: array
  196. items:
  197. $ref: '#/$defs/server'
  198. parameters:
  199. type: array
  200. items:
  201. $ref: '#/$defs/parameter-or-reference'
  202. patternProperties:
  203. '^(get|put|post|delete|options|head|patch|trace)$':
  204. $ref: '#/$defs/operation'
  205. $ref: '#/$defs/specification-extensions'
  206. unevaluatedProperties: false
  207. path-item-or-reference:
  208. if:
  209. required:
  210. - $ref
  211. then:
  212. $ref: '#/$defs/reference'
  213. else:
  214. $ref: '#/$defs/path-item'
  215. operation:
  216. type: object
  217. properties:
  218. tags:
  219. type: array
  220. items:
  221. type: string
  222. summary:
  223. type: string
  224. description:
  225. type: string
  226. externalDocs:
  227. $ref: '#/$defs/external-documentation'
  228. operationId:
  229. type: string
  230. parameters:
  231. type: array
  232. items:
  233. $ref: '#/$defs/parameter-or-reference'
  234. requestBody:
  235. $ref: '#/$defs/request-body-or-reference'
  236. responses:
  237. $ref: '#/$defs/responses'
  238. callbacks:
  239. type: object
  240. additionalProperties:
  241. $ref: '#/$defs/callbacks-or-reference'
  242. deprecated:
  243. default: false
  244. type: boolean
  245. security:
  246. type: array
  247. items:
  248. $ref: '#/$defs/security-requirement'
  249. servers:
  250. type: array
  251. items:
  252. $ref: '#/$defs/server'
  253. $ref: '#/$defs/specification-extensions'
  254. unevaluatedProperties: false
  255. external-documentation:
  256. type: object
  257. properties:
  258. description:
  259. type: string
  260. url:
  261. $ref: '#/$defs/uri'
  262. required:
  263. - url
  264. $ref: '#/$defs/specification-extensions'
  265. unevaluatedProperties: false
  266. parameter:
  267. type: object
  268. properties:
  269. name:
  270. type: string
  271. in:
  272. enum:
  273. - query
  274. - header
  275. - path
  276. - cookie
  277. description:
  278. type: string
  279. required:
  280. default: false
  281. type: boolean
  282. deprecated:
  283. default: false
  284. type: boolean
  285. allowEmptyValue:
  286. default: false
  287. type: boolean
  288. schema:
  289. $dynamicRef: '#meta'
  290. content:
  291. $ref: '#/$defs/content'
  292. required:
  293. - in
  294. oneOf:
  295. - required:
  296. - schema
  297. - required:
  298. - content
  299. dependentSchemas:
  300. schema:
  301. properties:
  302. style:
  303. type: string
  304. explode:
  305. type: boolean
  306. allowReserved:
  307. default: false
  308. type: boolean
  309. allOf:
  310. - $ref: '#/$defs/examples'
  311. - $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path'
  312. - $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header'
  313. - $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query'
  314. - $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie'
  315. - $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-form'
  316. $defs:
  317. styles-for-path:
  318. if:
  319. properties:
  320. in:
  321. const: path
  322. required:
  323. - in
  324. then:
  325. properties:
  326. style:
  327. default: simple
  328. enum:
  329. - matrix
  330. - label
  331. - simple
  332. required:
  333. const: true
  334. required:
  335. - required
  336. styles-for-header:
  337. if:
  338. properties:
  339. in:
  340. const: header
  341. required:
  342. - in
  343. then:
  344. properties:
  345. style:
  346. default: simple
  347. enum:
  348. - simple
  349. styles-for-query:
  350. if:
  351. properties:
  352. in:
  353. const: query
  354. required:
  355. - in
  356. then:
  357. properties:
  358. style:
  359. default: form
  360. enum:
  361. - form
  362. - spaceDelimited
  363. - pipeDelimited
  364. - deepObject
  365. styles-for-cookie:
  366. if:
  367. properties:
  368. in:
  369. const: cookie
  370. required:
  371. - in
  372. then:
  373. properties:
  374. style:
  375. default: form
  376. enum:
  377. - form
  378. styles-for-form:
  379. if:
  380. properties:
  381. style:
  382. const: form
  383. required:
  384. - style
  385. then:
  386. properties:
  387. explode:
  388. default: true
  389. else:
  390. properties:
  391. explode:
  392. default: false
  393. $ref: '#/$defs/specification-extensions'
  394. unevaluatedProperties: false
  395. parameter-or-reference:
  396. if:
  397. required:
  398. - $ref
  399. then:
  400. $ref: '#/$defs/reference'
  401. else:
  402. $ref: '#/$defs/parameter'
  403. request-body:
  404. type: object
  405. properties:
  406. description:
  407. type: string
  408. content:
  409. $ref: '#/$defs/content'
  410. required:
  411. default: false
  412. type: boolean
  413. required:
  414. - content
  415. $ref: '#/$defs/specification-extensions'
  416. unevaluatedProperties: false
  417. request-body-or-reference:
  418. if:
  419. required:
  420. - $ref
  421. then:
  422. $ref: '#/$defs/reference'
  423. else:
  424. $ref: '#/$defs/request-body'
  425. content:
  426. type: object
  427. additionalProperties:
  428. $ref: '#/$defs/media-type'
  429. propertyNames:
  430. format: media-range
  431. media-type:
  432. type: object
  433. properties:
  434. schema:
  435. $dynamicRef: '#meta'
  436. encoding:
  437. type: object
  438. additionalProperties:
  439. $ref: '#/$defs/encoding'
  440. allOf:
  441. - $ref: '#/$defs/specification-extensions'
  442. - $ref: '#/$defs/examples'
  443. unevaluatedProperties: false
  444. encoding:
  445. type: object
  446. properties:
  447. contentType:
  448. type: string
  449. format: media-range
  450. headers:
  451. type: object
  452. additionalProperties:
  453. $ref: '#/$defs/header-or-reference'
  454. style:
  455. default: form
  456. enum:
  457. - form
  458. - spaceDelimited
  459. - pipeDelimited
  460. - deepObject
  461. explode:
  462. type: boolean
  463. allowReserved:
  464. default: false
  465. type: boolean
  466. allOf:
  467. - $ref: '#/$defs/specification-extensions'
  468. - $ref: '#/$defs/encoding/$defs/explode-default'
  469. unevaluatedProperties: false
  470. $defs:
  471. explode-default:
  472. if:
  473. properties:
  474. style:
  475. const: form
  476. required:
  477. - style
  478. then:
  479. properties:
  480. explode:
  481. default: true
  482. else:
  483. properties:
  484. explode:
  485. default: false
  486. responses:
  487. type: object
  488. properties:
  489. default:
  490. $ref: '#/$defs/response-or-reference'
  491. patternProperties:
  492. '^[1-5][0-9X]{2}$':
  493. $ref: '#/$defs/response-or-reference'
  494. $ref: '#/$defs/specification-extensions'
  495. unevaluatedProperties: false
  496. response:
  497. type: object
  498. properties:
  499. description:
  500. type: string
  501. headers:
  502. type: object
  503. additionalProperties:
  504. $ref: '#/$defs/header-or-reference'
  505. content:
  506. $ref: '#/$defs/content'
  507. links:
  508. type: object
  509. additionalProperties:
  510. $ref: '#/$defs/link-or-reference'
  511. required:
  512. - description
  513. $ref: '#/$defs/specification-extensions'
  514. unevaluatedProperties: false
  515. response-or-reference:
  516. if:
  517. required:
  518. - $ref
  519. then:
  520. $ref: '#/$defs/reference'
  521. else:
  522. $ref: '#/$defs/response'
  523. callbacks:
  524. type: object
  525. $ref: '#/$defs/specification-extensions'
  526. additionalProperties:
  527. $ref: '#/$defs/path-item-or-reference'
  528. callbacks-or-reference:
  529. if:
  530. required:
  531. - $ref
  532. then:
  533. $ref: '#/$defs/reference'
  534. else:
  535. $ref: '#/$defs/callbacks'
  536. example:
  537. type: object
  538. properties:
  539. summary:
  540. type: string
  541. description:
  542. type: string
  543. value: true
  544. externalValue:
  545. $ref: '#/$defs/uri'
  546. $ref: '#/$defs/specification-extensions'
  547. unevaluatedProperties: false
  548. example-or-reference:
  549. if:
  550. required:
  551. - $ref
  552. then:
  553. $ref: '#/$defs/reference'
  554. else:
  555. $ref: '#/$defs/example'
  556. link:
  557. type: object
  558. properties:
  559. operationRef:
  560. $ref: '#/$defs/uri'
  561. operationId: true
  562. parameters:
  563. $ref: '#/$defs/map-of-strings'
  564. requestBody: true
  565. description:
  566. type: string
  567. body:
  568. $ref: '#/$defs/server'
  569. oneOf:
  570. - required:
  571. - operationRef
  572. - required:
  573. - operationId
  574. $ref: '#/$defs/specification-extensions'
  575. unevaluatedProperties: false
  576. link-or-reference:
  577. if:
  578. required:
  579. - $ref
  580. then:
  581. $ref: '#/$defs/reference'
  582. else:
  583. $ref: '#/$defs/link'
  584. header:
  585. type: object
  586. properties:
  587. description:
  588. type: string
  589. required:
  590. default: false
  591. type: boolean
  592. deprecated:
  593. default: false
  594. type: boolean
  595. allowEmptyValue:
  596. default: false
  597. type: boolean
  598. dependentSchemas:
  599. schema:
  600. properties:
  601. style:
  602. default: simple
  603. enum:
  604. - simple
  605. explode:
  606. default: false
  607. type: boolean
  608. allowReserved:
  609. default: false
  610. type: boolean
  611. schema:
  612. $dynamicRef: '#meta'
  613. $ref: '#/$defs/examples'
  614. content:
  615. properties:
  616. content:
  617. $ref: '#/$defs/content'
  618. $ref: '#/$defs/specification-extensions'
  619. unevaluatedProperties: false
  620. header-or-reference:
  621. if:
  622. required:
  623. - $ref
  624. then:
  625. $ref: '#/$defs/reference'
  626. else:
  627. $ref: '#/$defs/header'
  628. tag:
  629. type: object
  630. properties:
  631. name:
  632. type: string
  633. description:
  634. type: string
  635. externalDocs:
  636. $ref: '#/$defs/external-documentation'
  637. required:
  638. - name
  639. $ref: '#/$defs/specification-extensions'
  640. unevaluatedProperties: false
  641. reference:
  642. type: object
  643. properties:
  644. $ref:
  645. $ref: '#/$defs/uri'
  646. summary:
  647. type: string
  648. description:
  649. type: string
  650. unevaluatedProperties: false
  651. schema:
  652. $dynamicAnchor: meta
  653. type:
  654. - object
  655. - boolean
  656. security-scheme:
  657. type: object
  658. properties:
  659. type:
  660. enum:
  661. - apiKey
  662. - http
  663. - mutualTLS
  664. - oauth2
  665. - openIdConnect
  666. description:
  667. type: string
  668. required:
  669. - type
  670. allOf:
  671. - $ref: '#/$defs/specification-extensions'
  672. - $ref: '#/$defs/security-scheme/$defs/type-apikey'
  673. - $ref: '#/$defs/security-scheme/$defs/type-http'
  674. - $ref: '#/$defs/security-scheme/$defs/type-http-bearer'
  675. - $ref: '#/$defs/security-scheme/$defs/type-oauth2'
  676. - $ref: '#/$defs/security-scheme/$defs/type-oidc'
  677. unevaluatedProperties: false
  678. $defs:
  679. type-apikey:
  680. if:
  681. properties:
  682. type:
  683. const: apiKey
  684. required:
  685. - type
  686. then:
  687. properties:
  688. name:
  689. type: string
  690. in:
  691. enum:
  692. - query
  693. - header
  694. - cookie
  695. required:
  696. - name
  697. - in
  698. type-http:
  699. if:
  700. properties:
  701. type:
  702. const: http
  703. required:
  704. - type
  705. then:
  706. properties:
  707. scheme:
  708. type: string
  709. required:
  710. - scheme
  711. type-http-bearer:
  712. if:
  713. properties:
  714. type:
  715. const: http
  716. scheme:
  717. const: bearer
  718. required:
  719. - type
  720. - scheme
  721. then:
  722. properties:
  723. bearerFormat:
  724. type: string
  725. required:
  726. - scheme
  727. type-oauth2:
  728. if:
  729. properties:
  730. type:
  731. const: oauth2
  732. required:
  733. - type
  734. then:
  735. properties:
  736. flows:
  737. $ref: '#/$defs/oauth-flows'
  738. required:
  739. - flows
  740. type-oidc:
  741. if:
  742. properties:
  743. type:
  744. const: openIdConnect
  745. required:
  746. - type
  747. then:
  748. properties:
  749. openIdConnectUrl:
  750. $ref: '#/$defs/uri'
  751. required:
  752. - openIdConnectUrl
  753. security-scheme-or-reference:
  754. if:
  755. required:
  756. - $ref
  757. then:
  758. $ref: '#/$defs/reference'
  759. else:
  760. $ref: '#/$defs/security-scheme'
  761. oauth-flows:
  762. type: object
  763. properties:
  764. implicit:
  765. $ref: '#/$defs/oauth-flows/$defs/implicit'
  766. password:
  767. $ref: '#/$defs/oauth-flows/$defs/password'
  768. clientCredentials:
  769. $ref: '#/$defs/oauth-flows/$defs/client-credentials'
  770. authorizationCode:
  771. $ref: '#/$defs/oauth-flows/$defs/authorization-code'
  772. $ref: '#/$defs/specification-extensions'
  773. unevaluatedProperties: false
  774. $defs:
  775. implicit:
  776. type: object
  777. properties:
  778. authorizationUrl:
  779. type: string
  780. refreshUrl:
  781. type: string
  782. scopes:
  783. $ref: '#/$defs/map-of-strings'
  784. required:
  785. - authorizationUrl
  786. - scopes
  787. $ref: '#/$defs/specification-extensions'
  788. unevaluatedProperties: false
  789. password:
  790. type: object
  791. properties:
  792. tokenUrl:
  793. type: string
  794. refreshUrl:
  795. type: string
  796. scopes:
  797. $ref: '#/$defs/map-of-strings'
  798. required:
  799. - tokenUrl
  800. - scopes
  801. $ref: '#/$defs/specification-extensions'
  802. unevaluatedProperties: false
  803. client-credentials:
  804. type: object
  805. properties:
  806. tokenUrl:
  807. type: string
  808. refreshUrl:
  809. type: string
  810. scopes:
  811. $ref: '#/$defs/map-of-strings'
  812. required:
  813. - tokenUrl
  814. - scopes
  815. $ref: '#/$defs/specification-extensions'
  816. unevaluatedProperties: false
  817. authorization-code:
  818. type: object
  819. properties:
  820. authorizationUrl:
  821. type: string
  822. tokenUrl:
  823. type: string
  824. refreshUrl:
  825. type: string
  826. scopes:
  827. $ref: '#/$defs/map-of-strings'
  828. required:
  829. - authorizationUrl
  830. - tokenUrl
  831. - scopes
  832. $ref: '#/$defs/specification-extensions'
  833. unevaluatedProperties: false
  834. security-requirement:
  835. type: object
  836. additionalProperties:
  837. type: array
  838. items:
  839. type: string
  840. specification-extensions:
  841. patternProperties:
  842. '^x-': true
  843. examples:
  844. properties:
  845. example: true
  846. examples:
  847. type: object
  848. additionalProperties:
  849. $ref: '#/$defs/example-or-reference'
  850. uri:
  851. type: string
  852. format: uri
  853. map-of-strings:
  854. type: object
  855. additionalProperties:
  856. type: string