|
| 1 | +openapi: 3.0.0 |
| 2 | +x-stoplight: |
| 3 | + id: 70he5bttrcegx |
| 4 | +info: |
| 5 | + title: tutorial-api |
| 6 | + version: '1.0' |
| 7 | +servers: |
| 8 | + - url: 'http://localhost:3000' |
| 9 | +paths: |
| 10 | + /contents: |
| 11 | + post: |
| 12 | + summary: Create New Content |
| 13 | + operationId: post-content |
| 14 | + responses: |
| 15 | + '200': |
| 16 | + description: Content Created |
| 17 | + content: |
| 18 | + application/json: |
| 19 | + schema: |
| 20 | + type: array |
| 21 | + items: |
| 22 | + $ref: '#/components/schemas/Content' |
| 23 | + examples: {} |
| 24 | + requestBody: |
| 25 | + content: |
| 26 | + application/json: |
| 27 | + schema: |
| 28 | + $ref: '#/components/schemas/PostContentRequest' |
| 29 | + examples: {} |
| 30 | + description: Post the necessary fields for the API to create a new content. |
| 31 | + description: Create a new content. |
| 32 | + parameters: [] |
| 33 | + get: |
| 34 | + summary: Get Contents |
| 35 | + operationId: get-contents |
| 36 | + responses: |
| 37 | + '200': |
| 38 | + description: OK |
| 39 | + content: |
| 40 | + application/json: |
| 41 | + schema: |
| 42 | + type: array |
| 43 | + items: |
| 44 | + $ref: '#/components/schemas/Content' |
| 45 | + tags: |
| 46 | + - Content |
| 47 | + '/contents/{contentId}': |
| 48 | + parameters: |
| 49 | + - schema: |
| 50 | + type: string |
| 51 | + name: contentId |
| 52 | + in: path |
| 53 | + required: true |
| 54 | + get: |
| 55 | + summary: Get Content Info by Content ID |
| 56 | + tags: |
| 57 | + - Content |
| 58 | + responses: |
| 59 | + '200': |
| 60 | + description: Content Found |
| 61 | + content: |
| 62 | + application/json: |
| 63 | + schema: |
| 64 | + $ref: '#/components/schemas/Content' |
| 65 | + examples: |
| 66 | + Get Content Alice Smith: |
| 67 | + value: |
| 68 | + id: 142 |
| 69 | + firstName: Alice |
| 70 | + lastName: Smith |
| 71 | + |
| 72 | + dateOfBirth: '1997-10-31' |
| 73 | + emailVerified: true |
| 74 | + signUpDate: '2019-08-24' |
| 75 | + operationId: get-contents-contentId |
| 76 | + description: Retrieve the information of the content with the matching content ID. |
| 77 | + delete: |
| 78 | + summary: Delete a Content by Content ID |
| 79 | + operationId: delete-contents-contentsId |
| 80 | + responses: |
| 81 | + '204': |
| 82 | + description: No Content |
| 83 | + tags: |
| 84 | + - Content |
| 85 | + put: |
| 86 | + summary: Update a Content |
| 87 | + operationId: put-contents-contentsId |
| 88 | + responses: |
| 89 | + '200': |
| 90 | + description: OK |
| 91 | + content: |
| 92 | + application/json: |
| 93 | + schema: |
| 94 | + $ref: '#/components/schemas/Content' |
| 95 | + tags: |
| 96 | + - Content |
| 97 | + requestBody: |
| 98 | + content: |
| 99 | + application/json: |
| 100 | + schema: |
| 101 | + $ref: '#/components/schemas/PostContentRequest' |
| 102 | + description: 一部のパラメータのみの更新も可能とする |
| 103 | +components: |
| 104 | + schemas: |
| 105 | + Content: |
| 106 | + title: Content |
| 107 | + type: object |
| 108 | + description: '' |
| 109 | + x-examples: |
| 110 | + Alice Smith: |
| 111 | + id: 142 |
| 112 | + firstName: Alice |
| 113 | + lastName: Smith |
| 114 | + |
| 115 | + dateOfBirth: '1997-10-31' |
| 116 | + emailVerified: true |
| 117 | + signUpDate: '2019-08-24' |
| 118 | + properties: |
| 119 | + id: |
| 120 | + type: integer |
| 121 | + description: Unique identifier for the given content. |
| 122 | + title: |
| 123 | + type: string |
| 124 | + body: |
| 125 | + type: string |
| 126 | + createdAt: |
| 127 | + type: string |
| 128 | + format: date |
| 129 | + description: The date that the content was created. |
| 130 | + updatedAt: |
| 131 | + type: string |
| 132 | + required: |
| 133 | + - id |
| 134 | + - title |
| 135 | + - body |
| 136 | + PostContentRequest: |
| 137 | + title: PostContentRequest |
| 138 | + x-stoplight: |
| 139 | + id: uyyane08s9ozp |
| 140 | + type: object |
| 141 | + properties: |
| 142 | + title: |
| 143 | + type: string |
| 144 | + body: |
| 145 | + type: string |
| 146 | + requestBodies: {} |
0 commit comments