You are here

posts.yml in HTTP Client Manager 8.2

modules/http_client_manager_example/src/api/resources/posts.yml

File

modules/http_client_manager_example/src/api/resources/posts.yml
View source
  1. operations:
  2. CreatePost:
  3. httpMethod: "POST"
  4. uri: "posts"
  5. summary: "Create post"
  6. parameters:
  7. content-type:
  8. location: "header"
  9. default: "application/json"
  10. title:
  11. type: "string"
  12. location: "json"
  13. description: "The post title"
  14. required: true
  15. body:
  16. type: "string"
  17. location: "json"
  18. description: "The post body"
  19. required: true
  20. userId:
  21. type: "string"
  22. location: "json"
  23. description: "The post author id"
  24. required: true
  25. responseModel: "Post"
  26. FindPosts:
  27. httpMethod: "GET"
  28. uri: "posts"
  29. summary: "Find all the available posts."
  30. responseClass: "PostList"
  31. FindPost:
  32. httpMethod: "GET"
  33. uri: "posts/{postId}"
  34. summary: "Find a single post by id."
  35. parameters:
  36. postId:
  37. location: "uri"
  38. description: "Filter posts by id"
  39. required: true
  40. type: "integer"
  41. responseModel: "Post"
  42. FindComments:
  43. httpMethod: "GET"
  44. uri: "comments"
  45. summary: "Find all post comments."
  46. parameters:
  47. postId:
  48. location: "query"
  49. description: "Filter comments by post id"
  50. required: false
  51. type: "integer"
  52. models:
  53. Post:
  54. type: "object"
  55. location: "json"
  56. properties:
  57. userId:
  58. location: "json"
  59. type: "integer"
  60. id:
  61. location: "json"
  62. type: "integer"
  63. title:
  64. location: "json"
  65. type: "string"
  66. body:
  67. location: "json"
  68. type: "string"
  69. PostList:
  70. type: "array"
  71. location: "json"
  72. items:
  73. "$ref": "Post"