Advertisement
Guest User

Untitled

a guest
Sep 6th, 2017
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.46 KB | None | 0 0
  1. openapi: 3.0.0
  2. servers:
  3. - url: 'https://virtserver.swaggerhub.com/brooksn/API/1.0.0'
  4. - url: 'http://virtserver.swaggerhub.com/brooksn/API/1.0.0'
  5. info:
  6. description: This is a simple API
  7. version: 1.0.0
  8. title: The API
  9.  
  10. paths:
  11. /login:
  12. post:
  13. summary: Request a client token in exchange for a username and password
  14. responses:
  15. '200':
  16. description: >-
  17. Username and password matched a User; returning the User and client
  18. token
  19. content:
  20. '*/*':
  21. schema:
  22. type: object
  23. properties:
  24. data:
  25. type: object
  26. properties:
  27. clientToken:
  28. type: string
  29. /login/resetPassword:
  30. post:
  31. summary: Request a password reset email for the selected account
  32. responses:
  33. '200':
  34. description: >-
  35. Indicates an password reset email has been sent to the email address
  36. on file for the account
  37. '404':
  38. description: >-
  39. Indicates the account associated with the provided email address was
  40. not found
  41. parameters:
  42. - name: email
  43. in: query
  44. description: the email address of the account whose password should be reset
  45. schema:
  46. type: string
  47. /users:
  48. get:
  49. security:
  50. - clientBearer: []
  51. summary: retrieve a list of Users
  52. responses:
  53. '200':
  54. description: An array of Users
  55. content:
  56. application/json:
  57. schema:
  58. type: array
  59. items:
  60. $ref: '#/components/schemas/User'
  61. post:
  62. security:
  63. - clientBearer: []
  64. summary: create a new User
  65. responses:
  66. '200':
  67. description: A new User
  68. content:
  69. '*/*':
  70. schema:
  71. $ref: '#/components/schemas/User'
  72. '/users/{userId}':
  73. patch:
  74. security:
  75. - clientBearer: []
  76. summary: update fields on a single user
  77. responses:
  78. '200':
  79. description: The updated User document
  80. content:
  81. '*/*':
  82. schema:
  83. $ref: '#/components/schemas/User'
  84. parameters:
  85. - name: userId
  86. in: path
  87. description: The id of a User object
  88. required: true
  89. schema:
  90. type: string
  91. get:
  92. security:
  93. - clientBearer: []
  94. summary: retrieve a single user
  95. responses:
  96. '200':
  97. description: A User
  98. content:
  99. '*/*':
  100. schema:
  101. $ref: '#/components/schemas/User'
  102. parameters:
  103. - name: userId
  104. in: path
  105. description: The id of a User object
  106. required: true
  107. schema:
  108. type: string
  109. '/users/{userId}/password':
  110. put:
  111. security:
  112. - clientBearer: []
  113. summary: Update a single User password
  114. responses:
  115. '200':
  116. description: A User has had its password updated
  117. parameters:
  118. - name: userId
  119. in: path
  120. description: The id of a User object
  121. required: true
  122. schema:
  123. type: string
  124. requestBody:
  125. content:
  126. application/json:
  127. schema:
  128. type: object
  129. properties:
  130. oldPassword:
  131. type: string
  132. newPassword:
  133. type: string
  134. description: The password object
  135. required: true
  136. /projects:
  137. post:
  138. security:
  139. - clientBearer: []
  140. responses:
  141. '200':
  142. description: Create a new Project
  143. content:
  144. '*/*':
  145. schema:
  146. type: object
  147. properties:
  148. data:
  149. $ref: '#/components/schemas/Project'
  150. '400':
  151. description: A description of a client error
  152. content:
  153. '*/*':
  154. schema:
  155. $ref: '#/components/schemas/Errors'
  156. '500':
  157. description: A description of a client error
  158. content:
  159. '*/*':
  160. schema:
  161. $ref: '#/components/schemas/Errors'
  162. '/projects/{projectId}':
  163. parameters:
  164. - name: projectId
  165. in: path
  166. required: true
  167. description: id of Project object
  168. schema:
  169. type: string
  170. get:
  171. security:
  172. - clientBearer: []
  173. responses:
  174. '200':
  175. description: Retrieve a Project by id
  176. content:
  177. '*/*':
  178. schema:
  179. type: object
  180. properties:
  181. data:
  182. $ref: '#/components/schemas/Project'
  183. '400':
  184. description: A description of a client error
  185. content:
  186. '*/*':
  187. schema:
  188. $ref: '#/components/schemas/Errors'
  189. '500':
  190. description: A description of a server error
  191. content:
  192. '*/*':
  193. schema:
  194. $ref: '#/components/schemas/Errors'
  195. patch:
  196. security:
  197. - clientBearer: []
  198. responses:
  199. '200':
  200. description: Patch a Project by id and retrieve the updated object
  201. content:
  202. '*/*':
  203. schema:
  204. type: object
  205. properties:
  206. data:
  207. $ref: '#/components/schemas/Project'
  208. '400':
  209. description: A description of a client error
  210. content:
  211. '*/*':
  212. schema:
  213. $ref: '#/components/schemas/Errors'
  214. '500':
  215. description: A description of a server error
  216. content:
  217. '*/*':
  218. schema:
  219. $ref: '#/components/schemas/Errors'
  220. requestBody:
  221. content:
  222. application/json-patch+json:
  223. schema:
  224. $ref: '#/components/schemas/JsonPatch'
  225. description: JSON Patch per IETF RFC 6902
  226. required: true
  227. '/project/{projectId}/subscription':
  228. parameters:
  229. - name: projectId
  230. in: path
  231. required: true
  232. description: id of Project object
  233. schema:
  234. type: string
  235. post:
  236. security:
  237. - clientBearer: []
  238. responses:
  239. '200':
  240. description: Create a new subscription for a Project
  241. content:
  242. '*/*':
  243. schema:
  244. type: object
  245. properties:
  246. data:
  247. $ref: '#/components/schemas/Project'
  248. '400':
  249. description: A description of a client error
  250. content:
  251. '*/*':
  252. schema:
  253. $ref: '#/components/schemas/Errors'
  254. '500':
  255. description: A description of a client error
  256. content:
  257. '*/*':
  258. schema:
  259. $ref: '#/components/schemas/Errors'
  260. /bids:
  261. get:
  262. security:
  263. - clientBearer: []
  264. responses:
  265. '200':
  266. description: List Bids created by the logged-in User
  267. content:
  268. '*/*':
  269. schema:
  270. type: object
  271. properties:
  272. data:
  273. type: array
  274. items:
  275. $ref: '#/components/schemas/Bid'
  276. '400':
  277. description: A description of a client error
  278. content:
  279. '*/*':
  280. schema:
  281. $ref: '#/components/schemas/Errors'
  282. '500':
  283. description: A description of a client error
  284. content:
  285. '*/*':
  286. schema:
  287. $ref: '#/components/schemas/Errors'
  288. post:
  289. security:
  290. - clientBearer: []
  291. responses:
  292. '200':
  293. description: Create a new Bid for a Project
  294. content:
  295. '*/*':
  296. schema:
  297. type: object
  298. properties:
  299. data:
  300. $ref: '#/components/schemas/Bid'
  301. '400':
  302. description: A description of a client error
  303. content:
  304. '*/*':
  305. schema:
  306. $ref: '#/components/schemas/Errors'
  307. '500':
  308. description: A description of a client error
  309. content:
  310. '*/*':
  311. schema:
  312. $ref: '#/components/schemas/Errors'
  313. '/bids/{bidId}':
  314. parameters:
  315. - name: bidId
  316. in: path
  317. required: true
  318. description: The id of a Bid
  319. schema:
  320. type: string
  321. get:
  322. security:
  323. - clientBearer: []
  324. responses:
  325. '200':
  326. description: List Bids created by the logged-in User
  327. content:
  328. '*/*':
  329. schema:
  330. type: object
  331. properties:
  332. data:
  333. $ref: '#/components/schemas/Bid'
  334. '400':
  335. description: A description of a client error
  336. content:
  337. '*/*':
  338. schema:
  339. $ref: '#/components/schemas/Errors'
  340. '500':
  341. description: A description of a client error
  342. content:
  343. '*/*':
  344. schema:
  345. $ref: '#/components/schemas/Errors'
  346. '/invoices/{invoiceId}':
  347. get:
  348. security:
  349. - clientBearer: []
  350. summary: retrieve an Invoice
  351. responses:
  352. '200':
  353. description: An Invoice
  354. parameters:
  355. - name: invoiceId
  356. in: path
  357. required: true
  358. description: The id of an Invoice
  359. schema:
  360. type: string
  361. /messages:
  362. parameters: []
  363. post:
  364. security:
  365. - clientBearer: []
  366. summary: Get an array of project messages
  367. responses:
  368. '200':
  369. description: An array of messages
  370. content:
  371. '*/*':
  372. schema:
  373. $ref: '#/components/schemas/Message'
  374. '/messages/project/{projectId}':
  375. parameters:
  376. - name: projectId
  377. in: path
  378. required: true
  379. description: the ID of the project for which to retrieve messages
  380. schema:
  381. type: string
  382. get:
  383. security:
  384. - clientBearer: []
  385. summary: Get an array of project messages
  386. responses:
  387. '200':
  388. description: An array of messages
  389. content:
  390. '*/*':
  391. schema:
  392. type: object
  393. properties:
  394. messages:
  395. type: array
  396. items:
  397. $ref: '#/components/schemas/Message'
  398. /assets:
  399. post:
  400. security:
  401. - clientBearer: []
  402. summary: Upload a file
  403. responses:
  404. '200':
  405. description: An array of asset metadata
  406. content:
  407. '*/*':
  408. schema:
  409. type: object
  410. properties:
  411. messages:
  412. type: array
  413. items:
  414. $ref: '#/components/schemas/PublicFileMetaData'
  415. requestBody:
  416. content:
  417. application/octet-stream:
  418. schema:
  419. type: string
  420. format: binary
  421. components:
  422. securitySchemes:
  423. clientBearer:
  424. type: http
  425. scheme: bearer
  426. bearerFormat: JWT
  427. schemas:
  428. User:
  429. type: object
  430. properties:
  431. id:
  432. type: string
  433. format: uuid
  434. created:
  435. $ref: '#/components/schemas/Date'
  436. type:
  437. type: string
  438. enum:
  439. - User
  440. username:
  441. type: string
  442. format: uuid
  443. userType:
  444. type: string
  445. enum:
  446. - buyer
  447. - manufacturer
  448. email:
  449. type: string
  450. format: email
  451. name:
  452. type: string
  453. Project:
  454. type: object
  455. properties:
  456. id:
  457. type: string
  458. format: uuid
  459. created:
  460. $ref: '#/components/schemas/Date'
  461. type:
  462. type: string
  463. enum:
  464. - Category
  465. name:
  466. type: string
  467. quantity:
  468. type: string
  469. notes:
  470. type: string
  471. category:
  472. $ref: '#/components/schemas/Category'
  473. Category:
  474. type: object
  475. properties:
  476. id:
  477. type: string
  478. format: uuid
  479. created:
  480. $ref: '#/components/schemas/Date'
  481. type:
  482. type: string
  483. enum:
  484. - Category
  485. name:
  486. type: string
  487. pluralized:
  488. type: string
  489. approved:
  490. type: boolean
  491. Message:
  492. type: object
  493. required:
  494. - event
  495. - messageText
  496. properties:
  497. id:
  498. type: string
  499. format: uuid
  500. created:
  501. $ref: '#/components/schemas/Date'
  502. type:
  503. type: string
  504. enum:
  505. - Message
  506. user:
  507. $ref: '#/components/schemas/User'
  508. manufacturer:
  509. type: string
  510. format: uuid
  511. event:
  512. type: string
  513. messageText:
  514. type: string
  515. Bid:
  516. type: object
  517. properties:
  518. id:
  519. type: string
  520. format: uuid
  521. created:
  522. $ref: '#/components/schemas/Date'
  523. type:
  524. type: string
  525. enum:
  526. - Bid
  527. user:
  528. $ref: '#/components/schemas/User'
  529. project:
  530. $ref: '#/components/schemas/Project'
  531. Invoice:
  532. type: object
  533. required:
  534. - usdOwed
  535. - reason
  536. properties:
  537. id:
  538. type: string
  539. format: uuid
  540. created:
  541. $ref: '#/components/schemas/Date'
  542. type:
  543. type: string
  544. enum:
  545. - Invoice
  546. usdOwed:
  547. type: string
  548. reason:
  549. type: string
  550. PublicFileMetaData:
  551. type: object
  552. properties:
  553. url:
  554. type: string
  555. mimetype:
  556. type: string
  557. JsonPatch:
  558. type: array
  559. items:
  560. $ref: '#/components/schemas/PatchItem'
  561. PatchItem:
  562. description: A JSONPatch document as defined by RFC 6902
  563. required:
  564. - op
  565. - path
  566. properties:
  567. op:
  568. type: string
  569. description: The operation to be performed
  570. enum:
  571. - add
  572. - remove
  573. - replace
  574. path:
  575. type: string
  576. description: A JSON-Pointer
  577. value:
  578. type: object
  579. description: The value to be used within the operations.
  580. from:
  581. type: string
  582. description: A string containing a JSON Pointer value.
  583. type: object
  584. Errors:
  585. type: array
  586. minItems: 1
  587. maxItems: 1
  588. items:
  589. $ref: '#/components/schemas/Error'
  590. Error:
  591. type: object
  592. required:
  593. - title
  594. - detail
  595. properties:
  596. title:
  597. type: string
  598. detail:
  599. type: string
  600. Date:
  601. type: string
  602. description: ISO 8601 date and time
  603. example: '2017-08-18T17:59:45.632Z'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement