Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

743 строки
22 KiB

  1. openapi: 3.1.0
  2. info:
  3. title: 'Matsen API Platform'
  4. description: ''
  5. version: 1.0.0
  6. servers:
  7. -
  8. url: /
  9. description: ''
  10. paths:
  11. /api/posts:
  12. get:
  13. operationId: api_posts_get_collection
  14. tags:
  15. - Post
  16. responses:
  17. 200:
  18. description: 'Post collection'
  19. content:
  20. application/ld+json:
  21. schema:
  22. type: object
  23. properties:
  24. 'hydra:member': { type: array, items: { $ref: '#/components/schemas/Post.jsonld' } }
  25. 'hydra:totalItems': { type: integer, minimum: 0 }
  26. 'hydra:view': { type: object, properties: { '@id': { type: string, format: iri-reference }, '@type': { type: string }, 'hydra:first': { type: string, format: iri-reference }, 'hydra:last': { type: string, format: iri-reference }, 'hydra:previous': { type: string, format: iri-reference }, 'hydra:next': { type: string, format: iri-reference } }, example: { '@id': string, type: string, 'hydra:first': string, 'hydra:last': string, 'hydra:previous': string, 'hydra:next': string } }
  27. 'hydra:search': { type: object, properties: { '@type': { type: string }, 'hydra:template': { type: string }, 'hydra:variableRepresentation': { type: string }, 'hydra:mapping': { type: array, items: { type: object, properties: { '@type': { type: string }, variable: { type: string }, property: { type: [string, 'null'] }, required: { type: boolean } } } } } }
  28. required:
  29. - 'hydra:member'
  30. application/json:
  31. schema:
  32. type: array
  33. items:
  34. $ref: '#/components/schemas/Post'
  35. text/html:
  36. schema:
  37. type: array
  38. items:
  39. $ref: '#/components/schemas/Post'
  40. application/hal+json:
  41. schema:
  42. type: object
  43. properties:
  44. _embedded: { type: array, items: { $ref: '#/components/schemas/Post.jsonhal' } }
  45. totalItems: { type: integer, minimum: 0 }
  46. itemsPerPage: { type: integer, minimum: 0 }
  47. _links: { type: object, properties: { self: { type: object, properties: { href: { type: string, format: iri-reference } } }, first: { type: object, properties: { href: { type: string, format: iri-reference } } }, last: { type: object, properties: { href: { type: string, format: iri-reference } } }, next: { type: object, properties: { href: { type: string, format: iri-reference } } }, previous: { type: object, properties: { href: { type: string, format: iri-reference } } } } }
  48. required:
  49. - _links
  50. - _embedded
  51. summary: 'Retrieves the collection of Post resources.'
  52. description: 'Retrieves the collection of Post resources.'
  53. parameters:
  54. -
  55. name: page
  56. in: query
  57. description: 'The collection page number'
  58. required: false
  59. deprecated: false
  60. allowEmptyValue: true
  61. schema:
  62. type: integer
  63. default: 1
  64. style: form
  65. explode: false
  66. allowReserved: false
  67. deprecated: false
  68. post:
  69. operationId: api_posts_post
  70. tags:
  71. - Post
  72. responses:
  73. 201:
  74. description: 'Post resource created'
  75. content:
  76. application/ld+json:
  77. schema:
  78. $ref: '#/components/schemas/Post.jsonld'
  79. application/json:
  80. schema:
  81. $ref: '#/components/schemas/Post'
  82. text/html:
  83. schema:
  84. $ref: '#/components/schemas/Post'
  85. application/hal+json:
  86. schema:
  87. $ref: '#/components/schemas/Post.jsonhal'
  88. links: { }
  89. 400:
  90. description: 'Invalid input'
  91. 422:
  92. description: 'Unprocessable entity'
  93. summary: 'Creates a Post resource.'
  94. description: 'Creates a Post resource.'
  95. parameters: []
  96. requestBody:
  97. description: 'The new Post resource'
  98. content:
  99. application/ld+json:
  100. schema:
  101. $ref: '#/components/schemas/Post.jsonld'
  102. application/json:
  103. schema:
  104. $ref: '#/components/schemas/Post'
  105. text/html:
  106. schema:
  107. $ref: '#/components/schemas/Post'
  108. application/hal+json:
  109. schema:
  110. $ref: '#/components/schemas/Post.jsonhal'
  111. required: true
  112. deprecated: false
  113. parameters: []
  114. '/api/posts/{id}':
  115. get:
  116. operationId: api_posts_id_get
  117. tags:
  118. - Post
  119. responses:
  120. 200:
  121. description: 'Post resource'
  122. content:
  123. application/ld+json:
  124. schema:
  125. $ref: '#/components/schemas/Post.jsonld'
  126. application/json:
  127. schema:
  128. $ref: '#/components/schemas/Post'
  129. text/html:
  130. schema:
  131. $ref: '#/components/schemas/Post'
  132. application/hal+json:
  133. schema:
  134. $ref: '#/components/schemas/Post.jsonhal'
  135. 404:
  136. description: 'Resource not found'
  137. summary: 'Retrieves a Post resource.'
  138. description: 'Retrieves a Post resource.'
  139. parameters:
  140. -
  141. name: id
  142. in: path
  143. description: 'PostingApi identifier'
  144. required: true
  145. deprecated: false
  146. allowEmptyValue: false
  147. schema:
  148. type: string
  149. style: simple
  150. explode: false
  151. allowReserved: false
  152. deprecated: false
  153. delete:
  154. operationId: api_posts_id_delete
  155. tags:
  156. - Post
  157. responses:
  158. 204:
  159. description: 'Post resource deleted'
  160. 404:
  161. description: 'Resource not found'
  162. summary: 'Removes the Post resource.'
  163. description: 'Removes the Post resource.'
  164. parameters:
  165. -
  166. name: id
  167. in: path
  168. description: 'PostingApi identifier'
  169. required: true
  170. deprecated: false
  171. allowEmptyValue: false
  172. schema:
  173. type: string
  174. style: simple
  175. explode: false
  176. allowReserved: false
  177. deprecated: false
  178. patch:
  179. operationId: api_posts_id_patch
  180. tags:
  181. - Post
  182. responses:
  183. 200:
  184. description: 'Post resource updated'
  185. content:
  186. application/ld+json:
  187. schema:
  188. $ref: '#/components/schemas/Post.jsonld'
  189. application/json:
  190. schema:
  191. $ref: '#/components/schemas/Post'
  192. text/html:
  193. schema:
  194. $ref: '#/components/schemas/Post'
  195. application/hal+json:
  196. schema:
  197. $ref: '#/components/schemas/Post.jsonhal'
  198. links: { }
  199. 400:
  200. description: 'Invalid input'
  201. 422:
  202. description: 'Unprocessable entity'
  203. 404:
  204. description: 'Resource not found'
  205. summary: 'Updates the Post resource.'
  206. description: 'Updates the Post resource.'
  207. parameters:
  208. -
  209. name: id
  210. in: path
  211. description: 'PostingApi identifier'
  212. required: true
  213. deprecated: false
  214. allowEmptyValue: false
  215. schema:
  216. type: string
  217. style: simple
  218. explode: false
  219. allowReserved: false
  220. requestBody:
  221. description: 'The updated Post resource'
  222. content:
  223. application/merge-patch+json:
  224. schema:
  225. $ref: '#/components/schemas/Post'
  226. required: true
  227. deprecated: false
  228. parameters: []
  229. /api/users:
  230. get:
  231. operationId: api_users_get_collection
  232. tags:
  233. - User
  234. responses:
  235. 200:
  236. description: 'User collection'
  237. content:
  238. application/ld+json:
  239. schema:
  240. type: object
  241. properties:
  242. 'hydra:member': { type: array, items: { $ref: '#/components/schemas/User.jsonld' } }
  243. 'hydra:totalItems': { type: integer, minimum: 0 }
  244. 'hydra:view': { type: object, properties: { '@id': { type: string, format: iri-reference }, '@type': { type: string }, 'hydra:first': { type: string, format: iri-reference }, 'hydra:last': { type: string, format: iri-reference }, 'hydra:previous': { type: string, format: iri-reference }, 'hydra:next': { type: string, format: iri-reference } }, example: { '@id': string, type: string, 'hydra:first': string, 'hydra:last': string, 'hydra:previous': string, 'hydra:next': string } }
  245. 'hydra:search': { type: object, properties: { '@type': { type: string }, 'hydra:template': { type: string }, 'hydra:variableRepresentation': { type: string }, 'hydra:mapping': { type: array, items: { type: object, properties: { '@type': { type: string }, variable: { type: string }, property: { type: [string, 'null'] }, required: { type: boolean } } } } } }
  246. required:
  247. - 'hydra:member'
  248. application/json:
  249. schema:
  250. type: array
  251. items:
  252. $ref: '#/components/schemas/User'
  253. text/html:
  254. schema:
  255. type: array
  256. items:
  257. $ref: '#/components/schemas/User'
  258. application/hal+json:
  259. schema:
  260. type: object
  261. properties:
  262. _embedded: { type: array, items: { $ref: '#/components/schemas/User.jsonhal' } }
  263. totalItems: { type: integer, minimum: 0 }
  264. itemsPerPage: { type: integer, minimum: 0 }
  265. _links: { type: object, properties: { self: { type: object, properties: { href: { type: string, format: iri-reference } } }, first: { type: object, properties: { href: { type: string, format: iri-reference } } }, last: { type: object, properties: { href: { type: string, format: iri-reference } } }, next: { type: object, properties: { href: { type: string, format: iri-reference } } }, previous: { type: object, properties: { href: { type: string, format: iri-reference } } } } }
  266. required:
  267. - _links
  268. - _embedded
  269. summary: 'Retrieves the collection of User resources.'
  270. description: 'Retrieves the collection of User resources.'
  271. parameters:
  272. -
  273. name: page
  274. in: query
  275. description: 'The collection page number'
  276. required: false
  277. deprecated: false
  278. allowEmptyValue: true
  279. schema:
  280. type: integer
  281. default: 1
  282. style: form
  283. explode: false
  284. allowReserved: false
  285. deprecated: false
  286. post:
  287. operationId: api_users_post
  288. tags:
  289. - User
  290. responses:
  291. 201:
  292. description: 'User resource created'
  293. content:
  294. application/ld+json:
  295. schema:
  296. $ref: '#/components/schemas/User.jsonld'
  297. application/json:
  298. schema:
  299. $ref: '#/components/schemas/User'
  300. text/html:
  301. schema:
  302. $ref: '#/components/schemas/User'
  303. application/hal+json:
  304. schema:
  305. $ref: '#/components/schemas/User.jsonhal'
  306. links: { }
  307. 400:
  308. description: 'Invalid input'
  309. 422:
  310. description: 'Unprocessable entity'
  311. summary: 'Creates a User resource.'
  312. description: 'Creates a User resource.'
  313. parameters: []
  314. requestBody:
  315. description: 'The new User resource'
  316. content:
  317. application/ld+json:
  318. schema:
  319. $ref: '#/components/schemas/User.jsonld'
  320. application/json:
  321. schema:
  322. $ref: '#/components/schemas/User'
  323. text/html:
  324. schema:
  325. $ref: '#/components/schemas/User'
  326. application/hal+json:
  327. schema:
  328. $ref: '#/components/schemas/User.jsonhal'
  329. required: true
  330. deprecated: false
  331. parameters: []
  332. '/api/users/{id}':
  333. get:
  334. operationId: api_users_id_get
  335. tags:
  336. - User
  337. responses:
  338. 200:
  339. description: 'User resource'
  340. content:
  341. application/ld+json:
  342. schema:
  343. $ref: '#/components/schemas/User.jsonld'
  344. application/json:
  345. schema:
  346. $ref: '#/components/schemas/User'
  347. text/html:
  348. schema:
  349. $ref: '#/components/schemas/User'
  350. application/hal+json:
  351. schema:
  352. $ref: '#/components/schemas/User.jsonhal'
  353. 404:
  354. description: 'Resource not found'
  355. summary: 'Retrieves a User resource.'
  356. description: 'Retrieves a User resource.'
  357. parameters:
  358. -
  359. name: id
  360. in: path
  361. description: 'UserApi identifier'
  362. required: true
  363. deprecated: false
  364. allowEmptyValue: false
  365. schema:
  366. type: string
  367. style: simple
  368. explode: false
  369. allowReserved: false
  370. deprecated: false
  371. patch:
  372. operationId: api_users_id_patch
  373. tags:
  374. - User
  375. responses:
  376. 200:
  377. description: 'User resource updated'
  378. content:
  379. application/ld+json:
  380. schema:
  381. $ref: '#/components/schemas/User.jsonld'
  382. application/json:
  383. schema:
  384. $ref: '#/components/schemas/User'
  385. text/html:
  386. schema:
  387. $ref: '#/components/schemas/User'
  388. application/hal+json:
  389. schema:
  390. $ref: '#/components/schemas/User.jsonhal'
  391. links: { }
  392. 400:
  393. description: 'Invalid input'
  394. 422:
  395. description: 'Unprocessable entity'
  396. 404:
  397. description: 'Resource not found'
  398. summary: 'Updates the User resource.'
  399. description: 'Updates the User resource.'
  400. parameters:
  401. -
  402. name: id
  403. in: path
  404. description: 'UserApi identifier'
  405. required: true
  406. deprecated: false
  407. allowEmptyValue: false
  408. schema:
  409. type: string
  410. style: simple
  411. explode: false
  412. allowReserved: false
  413. requestBody:
  414. description: 'The updated User resource'
  415. content:
  416. application/merge-patch+json:
  417. schema:
  418. $ref: '#/components/schemas/User'
  419. required: true
  420. deprecated: false
  421. parameters: []
  422. /auth:
  423. post:
  424. operationId: login_check_post
  425. tags:
  426. - 'Login Check'
  427. responses:
  428. 200:
  429. description: 'User token created'
  430. content:
  431. application/json:
  432. schema:
  433. type: object
  434. properties:
  435. token: { readOnly: true, type: string, nullable: false }
  436. required:
  437. - token
  438. summary: 'Creates a user token.'
  439. description: 'Creates a user token.'
  440. requestBody:
  441. description: 'The login data'
  442. content:
  443. application/json:
  444. schema:
  445. type: object
  446. properties:
  447. email:
  448. type: string
  449. nullable: false
  450. password:
  451. type: string
  452. nullable: false
  453. required:
  454. - email
  455. - password
  456. required: true
  457. parameters: []
  458. components:
  459. schemas:
  460. Post:
  461. type: object
  462. description: ''
  463. deprecated: false
  464. required:
  465. - message
  466. properties:
  467. message:
  468. type:
  469. - string
  470. - 'null'
  471. owner:
  472. 'owl:maxCardinality': 1
  473. type:
  474. - string
  475. - 'null'
  476. format: iri-reference
  477. example: 'https://example.com/'
  478. createdAt:
  479. readOnly: true
  480. type:
  481. - string
  482. - 'null'
  483. format: date-time
  484. Post.jsonhal:
  485. type: object
  486. description: ''
  487. deprecated: false
  488. required:
  489. - message
  490. properties:
  491. _links:
  492. type: object
  493. properties:
  494. self:
  495. type: object
  496. properties:
  497. href:
  498. type: string
  499. format: iri-reference
  500. message:
  501. type:
  502. - string
  503. - 'null'
  504. owner:
  505. 'owl:maxCardinality': 1
  506. type:
  507. - string
  508. - 'null'
  509. format: iri-reference
  510. example: 'https://example.com/'
  511. createdAt:
  512. readOnly: true
  513. type:
  514. - string
  515. - 'null'
  516. format: date-time
  517. Post.jsonld:
  518. type: object
  519. description: ''
  520. deprecated: false
  521. required:
  522. - message
  523. properties:
  524. '@context':
  525. readOnly: true
  526. oneOf:
  527. -
  528. type: string
  529. -
  530. type: object
  531. properties:
  532. '@vocab':
  533. type: string
  534. hydra:
  535. type: string
  536. enum: ['http://www.w3.org/ns/hydra/core#']
  537. required:
  538. - '@vocab'
  539. - hydra
  540. additionalProperties: true
  541. '@id':
  542. readOnly: true
  543. type: string
  544. '@type':
  545. readOnly: true
  546. type: string
  547. message:
  548. type:
  549. - string
  550. - 'null'
  551. owner:
  552. 'owl:maxCardinality': 1
  553. type:
  554. - string
  555. - 'null'
  556. format: iri-reference
  557. example: 'https://example.com/'
  558. createdAt:
  559. readOnly: true
  560. type:
  561. - string
  562. - 'null'
  563. format: date-time
  564. User:
  565. type: object
  566. description: ''
  567. deprecated: false
  568. required:
  569. - email
  570. - firstName
  571. - lastName
  572. properties:
  573. email:
  574. format: email
  575. externalDocs:
  576. url: 'https://schema.org/email'
  577. type:
  578. - string
  579. - 'null'
  580. firstName:
  581. type:
  582. - string
  583. - 'null'
  584. lastName:
  585. type:
  586. - string
  587. - 'null'
  588. password:
  589. writeOnly: true
  590. description: 'The plaintext password when being set or changed.'
  591. type:
  592. - string
  593. - 'null'
  594. active:
  595. type: boolean
  596. createdAt:
  597. readOnly: true
  598. type:
  599. - string
  600. - 'null'
  601. format: date-time
  602. userPosts:
  603. type: array
  604. items:
  605. type: string
  606. format: iri-reference
  607. example: 'https://example.com/'
  608. User.jsonhal:
  609. type: object
  610. description: ''
  611. deprecated: false
  612. required:
  613. - email
  614. - firstName
  615. - lastName
  616. properties:
  617. _links:
  618. type: object
  619. properties:
  620. self:
  621. type: object
  622. properties:
  623. href:
  624. type: string
  625. format: iri-reference
  626. email:
  627. format: email
  628. externalDocs:
  629. url: 'https://schema.org/email'
  630. type:
  631. - string
  632. - 'null'
  633. firstName:
  634. type:
  635. - string
  636. - 'null'
  637. lastName:
  638. type:
  639. - string
  640. - 'null'
  641. password:
  642. writeOnly: true
  643. description: 'The plaintext password when being set or changed.'
  644. type:
  645. - string
  646. - 'null'
  647. active:
  648. type: boolean
  649. createdAt:
  650. readOnly: true
  651. type:
  652. - string
  653. - 'null'
  654. format: date-time
  655. userPosts:
  656. type: array
  657. items:
  658. type: string
  659. format: iri-reference
  660. example: 'https://example.com/'
  661. User.jsonld:
  662. type: object
  663. description: ''
  664. deprecated: false
  665. required:
  666. - email
  667. - firstName
  668. - lastName
  669. properties:
  670. '@context':
  671. readOnly: true
  672. oneOf:
  673. -
  674. type: string
  675. -
  676. type: object
  677. properties:
  678. '@vocab':
  679. type: string
  680. hydra:
  681. type: string
  682. enum: ['http://www.w3.org/ns/hydra/core#']
  683. required:
  684. - '@vocab'
  685. - hydra
  686. additionalProperties: true
  687. '@id':
  688. readOnly: true
  689. type: string
  690. '@type':
  691. readOnly: true
  692. type: string
  693. email:
  694. format: email
  695. externalDocs:
  696. url: 'https://schema.org/email'
  697. type:
  698. - string
  699. - 'null'
  700. firstName:
  701. type:
  702. - string
  703. - 'null'
  704. lastName:
  705. type:
  706. - string
  707. - 'null'
  708. password:
  709. writeOnly: true
  710. description: 'The plaintext password when being set or changed.'
  711. type:
  712. - string
  713. - 'null'
  714. active:
  715. type: boolean
  716. createdAt:
  717. readOnly: true
  718. type:
  719. - string
  720. - 'null'
  721. format: date-time
  722. userPosts:
  723. type: array
  724. items:
  725. type: string
  726. format: iri-reference
  727. example: 'https://example.com/'
  728. responses: { }
  729. parameters: { }
  730. examples: { }
  731. requestBodies: { }
  732. headers: { }
  733. securitySchemes:
  734. JWT:
  735. type: http
  736. scheme: bearer
  737. bearerFormat: JWT
  738. security:
  739. -
  740. JWT: []
  741. tags: []