Advertisement
Guest User

Untitled

a guest
Jun 6th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.38 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3. description: "This is a test API Documentation for the new project."
  4. version: "1.0.0"
  5. title: "PTA App"
  6. contact:
  7. email: "rajesh.banskota@schittly.com"
  8. license:
  9. name: "Apache 2.0"
  10. url: "http://www.apache.org/licenses/LICENSE-2.0.html"
  11. host: "datblygu.de"
  12. basePath: "/pta/v1"
  13. tags:
  14. - name: "article"
  15. description: "Everything about the Articles"
  16. externalDocs:
  17. description: "Find out more"
  18. url: "http://swagger.io"
  19. - name: "favorite"
  20. description: "Operations about favorite"
  21. - name: "comment"
  22. description: "Operations about user comment"
  23. - name: "user"
  24. description: "Operations about user"
  25. externalDocs:
  26. description: "Find out more about our store"
  27. url: "http://swagger.io"
  28. schemes:
  29. - "http"
  30.  
  31. paths:
  32. /article/findByType:
  33. get:
  34. tags:
  35. - "article"
  36. summary: "Finds articles by type"
  37. description: "type of the articles"
  38. operationId: "findArticlesByType"
  39. produces:
  40. - "application/json"
  41. parameters:
  42. - name: "type"
  43. in: "query"
  44. description: "Type values that need to be considered for filter"
  45. required: true
  46. type: "string"
  47. responses:
  48. 200:
  49. description: "successful operation"
  50. schema:
  51. type: "array"
  52. items:
  53. $ref: "#/definitions/ArticleLight"
  54. 400:
  55. description: "Invalid type value"
  56.  
  57. /article/findByTags:
  58. get:
  59. tags:
  60. - "article"
  61. summary: "Finds Articles by tags"
  62. description: "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing."
  63. operationId: "findArticlesByTags"
  64. produces:
  65. - "application/json"
  66. parameters:
  67. - name: "tags"
  68. in: "query"
  69. description: "Tags to filter by"
  70. required: true
  71. type: "array"
  72. items:
  73. type: "string"
  74. collectionFormat: "multi"
  75. responses:
  76. 200:
  77. description: "successful operation"
  78. schema:
  79. type: "array"
  80. items:
  81. $ref: "#/definitions/Article"
  82. 400:
  83. description: "Invalid tags value"
  84.  
  85. /article/{articleId}:
  86. get:
  87. tags:
  88. - "article"
  89. summary: "Find Article by ID"
  90. description: "Returns a single Article Detail"
  91. operationId: "getPetById"
  92. produces:
  93. - "application/json"
  94. parameters:
  95. - name: "articleId"
  96. in: "path"
  97. description: "ID of an article to return"
  98. required: true
  99. type: "integer"
  100. responses:
  101. 200:
  102. description: "successful operation"
  103. schema:
  104. $ref: "#/definitions/Article"
  105. 400:
  106. description: "Invalid ID supplied"
  107. 404:
  108. description: "Article not found"
  109.  
  110. /favorite:
  111. get:
  112. tags:
  113. - "favorite"
  114. summary: "Returns all user favorites"
  115. description: "Returns a list of favorites of an user"
  116. operationId: "getFavorites"
  117. produces:
  118. - "application/json"
  119. parameters:
  120. - name: "userid"
  121. in: "query"
  122. description: "The user id for which favorites are to be extracted"
  123. required: true
  124. type: "integer"
  125. - name: "articleid"
  126. in: "query"
  127. description: "The article id"
  128. required: false
  129. type: "integer"
  130. responses:
  131. 200:
  132. description: "successful operation"
  133. schema:
  134. $ref: "#/definitions/Favorite"
  135. 404:
  136. description: "favorites not found"
  137. security:
  138. - pta_app_auth: []
  139.  
  140. /favorite/create:
  141. post:
  142. tags:
  143. - "favorite"
  144. summary: "create a new comment"
  145. description: ""
  146. operationId: "createFavorite"
  147. produces:
  148. - "application/json"
  149. parameters:
  150. - in: "body"
  151. name: "body"
  152. description: "new favorite submitted"
  153. required: true
  154. schema:
  155. $ref: "#/definitions/Savefavorite"
  156. responses:
  157. 200:
  158. description: "successful operation"
  159. schema:
  160. $ref: "#/definitions/Favorite"
  161. 400:
  162. description: "Invalid Article ID"
  163. security:
  164. - pta_app_auth: []
  165. /favorite/delete:
  166. delete:
  167. tags:
  168. - "favorite"
  169. summary: "Deletes a favorite"
  170. description: ""
  171. operationId: "deleteFavorite"
  172. produces:
  173. - "application/json"
  174. parameters:
  175. - name: "favId"
  176. in: "query"
  177. description: "favorite id to delete"
  178. required: true
  179. type: "integer"
  180. responses:
  181. 400:
  182. description: "Invalid ID supplied"
  183. 404:
  184. description: "favorite not found"
  185. security:
  186. - pta_app_auth: []
  187. /comment:
  188. get:
  189. tags:
  190. - "comment"
  191. summary: "Returns all user comments"
  192. description: "Returns a list of comments from users"
  193. operationId: "getComments"
  194. produces:
  195. - "application/json"
  196. parameters:
  197. - name: "articleid"
  198. in: "query"
  199. description: "The article id for which comments are to be extracted"
  200. required: true
  201. type: "integer"
  202. responses:
  203. 200:
  204. description: "successful operation"
  205. schema:
  206. $ref: "#/definitions/Comment"
  207. 404:
  208. description: "comments not found"
  209.  
  210. /comment/create:
  211. post:
  212. tags:
  213. - "comment"
  214. summary: "create a new comment"
  215. description: ""
  216. operationId: "createComment"
  217. produces:
  218. - "application/json"
  219. parameters:
  220. - in: "body"
  221. name: "body"
  222. description: "new comment submitted"
  223. required: true
  224. schema:
  225. $ref: "#/definitions/Savecomment"
  226. responses:
  227. 200:
  228. description: "successful operation"
  229. schema:
  230. $ref: "#/definitions/Comment"
  231. 400:
  232. description: "Invalid Comment"
  233. security:
  234. - pta_app_auth: []
  235. /user/create:
  236. post:
  237. tags:
  238. - "user"
  239. summary: "Add a new user to the system"
  240. description: ""
  241. operationId: "addUser"
  242. consumes:
  243. - "application/json"
  244. produces:
  245. - "application/json"
  246. parameters:
  247. - in: "body"
  248. name: "body"
  249. description: "User object that needs to be added to the system"
  250. required: true
  251. schema:
  252. $ref: "#/definitions/User"
  253. responses:
  254. 405:
  255. description: "Invalid input"
  256. /user/login:
  257. get:
  258. tags:
  259. - "user"
  260. summary: "Logs user into the system"
  261. description: ""
  262. operationId: "loginUser"
  263. produces:
  264. - "application/json"
  265. parameters:
  266. - name: "email"
  267. in: "query"
  268. description: "The user name in this case is email for login"
  269. required: true
  270. type: "string"
  271. - name: "password"
  272. in: "query"
  273. description: "The password for login in clear text"
  274. required: true
  275. type: "string"
  276. responses:
  277. 200:
  278. description: "successful operation"
  279. schema:
  280. type: "string"
  281. headers:
  282. X-Rate-Limit:
  283. type: "integer"
  284. format: "int32"
  285. description: "calls per hour allowed by the user"
  286. X-Expires-After:
  287. type: "string"
  288. format: "date-time"
  289. description: "date in UTC when token expires"
  290. 400:
  291. description: "Invalid username/password supplied"
  292. /user/logout:
  293. get:
  294. tags:
  295. - "user"
  296. summary: "Logs out current logged in user session"
  297. description: ""
  298. operationId: "logoutUser"
  299. produces:
  300. - "application/json"
  301. parameters: []
  302. responses:
  303. default:
  304. description: "successful operation"
  305. /user:
  306. get:
  307. tags:
  308. - "user"
  309. summary: "Get user by user name(email)"
  310. description: ""
  311. operationId: "getUserByEmail"
  312. produces:
  313. - "application/json"
  314. parameters:
  315. - name: "email"
  316. in: "query"
  317. description: "The email(username) of the user that needs to be fetched."
  318. required: true
  319. type: "string"
  320. responses:
  321. 200:
  322. description: "successful operation"
  323. schema:
  324. $ref: "#/definitions/User"
  325. 400:
  326. description: "Invalid username supplied"
  327. 404:
  328. description: "User not found"
  329. security:
  330. - pta_app_auth: []
  331. /user/update:
  332. put:
  333. tags:
  334. - "user"
  335. summary: "Updated user"
  336. description: "This can only be done by the logged in user."
  337. operationId: "updateUser"
  338. produces:
  339. - "application/json"
  340. parameters:
  341. - name: "userid"
  342. in: "query"
  343. description: "id of the user that need to be updated"
  344. required: true
  345. type: "integer"
  346. - in: "body"
  347. name: "body"
  348. description: "Updated user object"
  349. required: true
  350. schema:
  351. $ref: "#/definitions/User"
  352. responses:
  353. 400:
  354. description: "Invalid user Id supplied"
  355. 404:
  356. description: "User not found"
  357. security:
  358. - pta_app_auth: []
  359. /user/uploadImage:
  360. post:
  361. tags:
  362. - "user"
  363. summary: "uploads an profile image"
  364. description: ""
  365. operationId: "uploadProfileImage"
  366. consumes:
  367. - "multipart/form-data"
  368. produces:
  369. - "application/json"
  370. parameters:
  371. - name: "userId"
  372. in: "query"
  373. description: "ID of user to update"
  374. required: true
  375. type: "integer"
  376. - name: "additionalMetadata"
  377. in: "formData"
  378. description: "Additional data to pass to server"
  379. required: false
  380. type: "string"
  381. - name: "file"
  382. in: "formData"
  383. description: "file to upload"
  384. required: false
  385. type: "file"
  386. responses:
  387. 200:
  388. description: "successful operation"
  389. schema:
  390. $ref: "#/definitions/ApiResponse"
  391. security:
  392. - pta_app_auth: []
  393.  
  394. securityDefinitions:
  395. pta_app_auth:
  396. type: "basic"
  397.  
  398. definitions:
  399. Order:
  400. type: "object"
  401. properties:
  402. id:
  403. type: "integer"
  404. format: "int64"
  405. petId:
  406. type: "integer"
  407. format: "int64"
  408. quantity:
  409. type: "integer"
  410. format: "int32"
  411. shipDate:
  412. type: "string"
  413. format: "date-time"
  414. status:
  415. type: "string"
  416. description: "Order Status"
  417. enum:
  418. - "placed"
  419. - "approved"
  420. - "delivered"
  421. complete:
  422. type: "boolean"
  423. default: false
  424. xml:
  425. name: "Order"
  426. Category:
  427. type: "object"
  428. properties:
  429. id:
  430. type: "integer"
  431. format: "int64"
  432. name:
  433. type: "string"
  434. xml:
  435. name: "Category"
  436. User:
  437. type: "object"
  438. properties:
  439. id:
  440. type: "integer"
  441. format: "int64"
  442. firstName:
  443. type: "string"
  444. lastName:
  445. type: "string"
  446. email:
  447. type: "string"
  448. password:
  449. type: "string"
  450. imageUrl:
  451. type: "string"
  452. pushNotificationActivities:
  453. type: "boolean"
  454. pushNotificationOffers:
  455. type: "boolean"
  456. xml:
  457. name: "User"
  458. Favorite:
  459. type: "object"
  460. properties:
  461. id:
  462. type: "integer"
  463. format: "int64"
  464. articleid:
  465. type: "integer"
  466. xml:
  467. name: "Favorite"
  468. Savefavorite:
  469. type: "object"
  470. properties:
  471. userid:
  472. type: "integer"
  473. articleid:
  474. type: "integer"
  475. xml:
  476. name: "Savefavorite"
  477. Comment:
  478. type: "object"
  479. properties:
  480. id:
  481. type: "integer"
  482. format: "int64"
  483. firstName:
  484. type: "string"
  485. image:
  486. type: "string"
  487. comment:
  488. type: "string"
  489. xml:
  490. name: "Comment"
  491. Savecomment:
  492. type: "object"
  493. properties:
  494. userid:
  495. type: "integer"
  496. format: "int64"
  497. articleid:
  498. type: "integer"
  499. format: "int64"
  500. comment:
  501. type: "string"
  502. xml:
  503. name: "Savecomment"
  504. Tag:
  505. type: "object"
  506. properties:
  507. id:
  508. type: "integer"
  509. name:
  510. type: "string"
  511. xml:
  512. name: "Tag"
  513. Certify:
  514. type: "object"
  515. properties:
  516. id:
  517. type: "integer"
  518. name:
  519. type: "string"
  520. badgeUrl:
  521. type: "string"
  522. xml:
  523. name: "Certify"
  524. ArticleLight:
  525. type: "object"
  526. properties:
  527. id:
  528. type: "integer"
  529. type:
  530. type: "string"
  531. category:
  532. $ref: "#/definitions/Category"
  533. headline:
  534. type: "string"
  535. title:
  536. type: "string"
  537. teasertext:
  538. type: "string"
  539. teaserImageUrl:
  540. type: "string"
  541. contentType:
  542. type: "string"
  543. description: "content of the article"
  544. enum:
  545. - "video"
  546. - "audio"
  547. - "test"
  548. - "relax"
  549. tags:
  550. type: "array"
  551. xml:
  552. name: "tag"
  553. wrapped: true
  554. items:
  555. $ref: "#/definitions/Tag"
  556. successCertification:
  557. $ref: "#/definitions/Certify"
  558. xml:
  559. name: "ArticleLight"
  560. Article:
  561. type: "object"
  562. properties:
  563. id:
  564. type: "integer"
  565. type:
  566. type: "string"
  567. category:
  568. $ref: "#/definitions/Category"
  569. headline:
  570. type: "string"
  571. title:
  572. type: "string"
  573. teasertext:
  574. type: "string"
  575. teaserImageUrl:
  576. type: "string"
  577. contentType:
  578. type: "string"
  579. description: "content of the article"
  580. enum:
  581. - "video"
  582. - "audio"
  583. - "test"
  584. - "relax"
  585. tags:
  586. type: "array"
  587. xml:
  588. name: "tag"
  589. wrapped: true
  590. items:
  591. $ref: "#/definitions/Tag"
  592. bodytext:
  593. type: "string"
  594. description: "main content of the article"
  595. successCertification:
  596. $ref: "#/definitions/Certify"
  597. xml:
  598. name: "Article"
  599.  
  600. Pet:
  601. type: "object"
  602. required:
  603. - "name"
  604. - "photoUrls"
  605. properties:
  606. id:
  607. type: "integer"
  608. format: "int64"
  609. category:
  610. $ref: "#/definitions/Category"
  611. name:
  612. type: "string"
  613. example: "doggie"
  614. photoUrls:
  615. type: "array"
  616. xml:
  617. name: "photoUrl"
  618. wrapped: true
  619. items:
  620. type: "string"
  621. tags:
  622. type: "array"
  623. xml:
  624. name: "tag"
  625. wrapped: true
  626. items:
  627. $ref: "#/definitions/Tag"
  628. status:
  629. type: "string"
  630. description: "pet status in the store"
  631. enum:
  632. - "available"
  633. - "pending"
  634. - "sold"
  635. xml:
  636. name: "Pet"
  637. ApiResponse:
  638. type: "object"
  639. properties:
  640. code:
  641. type: "integer"
  642. format: "int32"
  643. type:
  644. type: "string"
  645. message:
  646. type: "string"
  647. externalDocs:
  648. description: "Find out more about Swagger"
  649. url: "http://swagger.io"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement