/ docs / swagger.yaml
swagger.yaml
  1  basePath: /api/v1
  2  consumes:
  3  - application/json
  4  definitions:
  5    feeds.FeedCreateModel:
  6      properties:
  7        group:
  8          maxLength: 32
  9          type: string
 10        name:
 11          maxLength: 32
 12          type: string
 13        password:
 14          type: string
 15        url:
 16          type: string
 17        username:
 18          type: string
 19      required:
 20      - url
 21      type: object
 22    feeds.FeedCreateResponse:
 23      properties:
 24        feed:
 25          $ref: '#/definitions/feeds.FeedShowModel'
 26        message:
 27          type: string
 28        success:
 29          type: boolean
 30      type: object
 31    feeds.FeedListResponse:
 32      properties:
 33        feeds:
 34          items:
 35            $ref: '#/definitions/feeds.FeedShowModel'
 36          type: array
 37        message:
 38          type: string
 39        success:
 40          type: boolean
 41      type: object
 42    feeds.FeedShowModel:
 43      properties:
 44        group:
 45          maxLength: 32
 46          type: string
 47        id:
 48          type: string
 49        name:
 50          maxLength: 32
 51          type: string
 52        url:
 53          type: string
 54      type: object
 55    feeds.FeedShowResponse:
 56      properties:
 57        feed:
 58          $ref: '#/definitions/feeds.FeedShowModel'
 59        message:
 60          type: string
 61        success:
 62          type: boolean
 63      type: object
 64    tokens.TokenCreateModel:
 65      properties:
 66        name:
 67          maxLength: 32
 68          type: string
 69      required:
 70      - name
 71      type: object
 72    tokens.TokenCreateResponse:
 73      properties:
 74        message:
 75          type: string
 76        success:
 77          type: boolean
 78        token:
 79          $ref: '#/definitions/tokens.TokenShowModel'
 80      type: object
 81    tokens.TokenShowModel:
 82      properties:
 83        id:
 84          type: string
 85        token:
 86          type: string
 87        tokenname:
 88          type: string
 89        type:
 90          type: string
 91      type: object
 92    users.UserCreateModel:
 93      properties:
 94        password:
 95          type: string
 96        role:
 97          type: string
 98        username:
 99          maxLength: 32
100          type: string
101      required:
102      - password
103      - role
104      - username
105      type: object
106    users.UserCreateResponse:
107      properties:
108        message:
109          type: string
110        success:
111          type: boolean
112        user:
113          $ref: '#/definitions/users.UserShowModel'
114      type: object
115    users.UserListResponse:
116      properties:
117        message:
118          type: string
119        success:
120          type: boolean
121        users:
122          items:
123            $ref: '#/definitions/users.UserShowModel'
124          type: array
125      type: object
126    users.UserShowModel:
127      properties:
128        id:
129          type: string
130        role:
131          type: string
132        username:
133          type: string
134      type: object
135    users.UserShowResponse:
136      properties:
137        message:
138          type: string
139        success:
140          type: boolean
141        user:
142          $ref: '#/definitions/users.UserShowModel'
143      type: object
144    users.UserUpdateModel:
145      properties:
146        password:
147          minLength: 5
148          type: string
149        role:
150          type: string
151      type: object
152    users.UserUpdateResponse:
153      properties:
154        message:
155          type: string
156        success:
157          type: boolean
158        user:
159          $ref: '#/definitions/users.UserShowModel'
160      type: object
161  host: localhost:8000
162  info:
163    contact:
164      email: marius@xn--gckvb8fzb.com
165      name: Marius
166      url: https://xn--gckvb8fzb.com
167    description: The Journalist REST API v1
168    license:
169      name: GPL-3.0
170      url: https://github.com/mrusme/journalist/blob/master/LICENSE
171    title: Journalist API
172    version: "1.0"
173  paths:
174    /feeds:
175      get:
176        consumes:
177        - application/json
178        description: Get all feeds
179        produces:
180        - application/json
181        responses:
182          "200":
183            description: OK
184            schema:
185              $ref: '#/definitions/feeds.FeedListResponse'
186          "400":
187            description: Bad Request
188            schema:
189              $ref: '#/definitions/feeds.FeedListResponse'
190          "404":
191            description: Not Found
192            schema:
193              $ref: '#/definitions/feeds.FeedListResponse'
194          "500":
195            description: Internal Server Error
196            schema:
197              $ref: '#/definitions/feeds.FeedListResponse'
198        security:
199        - BasicAuth: []
200        summary: List feeds
201        tags:
202        - feeds
203      post:
204        consumes:
205        - application/json
206        description: Add a new feed
207        parameters:
208        - description: Add feed
209          in: body
210          name: feed
211          required: true
212          schema:
213            $ref: '#/definitions/feeds.FeedCreateModel'
214        produces:
215        - application/json
216        responses:
217          "200":
218            description: OK
219            schema:
220              $ref: '#/definitions/feeds.FeedCreateResponse'
221          "400":
222            description: Bad Request
223            schema:
224              $ref: '#/definitions/feeds.FeedCreateResponse'
225          "404":
226            description: Not Found
227            schema:
228              $ref: '#/definitions/feeds.FeedCreateResponse'
229          "500":
230            description: Internal Server Error
231            schema:
232              $ref: '#/definitions/feeds.FeedCreateResponse'
233        security:
234        - BasicAuth: []
235        summary: Create a feed
236        tags:
237        - feeds
238    /feeds/{id}:
239      get:
240        consumes:
241        - application/json
242        description: Get feed by ID
243        parameters:
244        - description: Feed ID
245          in: path
246          name: id
247          required: true
248          type: string
249        produces:
250        - application/json
251        responses:
252          "200":
253            description: OK
254            schema:
255              $ref: '#/definitions/feeds.FeedShowResponse'
256          "400":
257            description: Bad Request
258            schema:
259              $ref: '#/definitions/feeds.FeedShowResponse'
260          "404":
261            description: Not Found
262            schema:
263              $ref: '#/definitions/feeds.FeedShowResponse'
264          "500":
265            description: Internal Server Error
266            schema:
267              $ref: '#/definitions/feeds.FeedShowResponse'
268        security:
269        - BasicAuth: []
270        summary: Show a feed
271        tags:
272        - feeds
273    /tokens:
274      post:
275        consumes:
276        - application/json
277        description: Add a new token
278        parameters:
279        - description: Add token
280          in: body
281          name: token
282          required: true
283          schema:
284            $ref: '#/definitions/tokens.TokenCreateModel'
285        produces:
286        - application/json
287        responses:
288          "200":
289            description: OK
290            schema:
291              $ref: '#/definitions/tokens.TokenCreateResponse'
292          "400":
293            description: Bad Request
294            schema:
295              $ref: '#/definitions/tokens.TokenCreateResponse'
296          "404":
297            description: Not Found
298            schema:
299              $ref: '#/definitions/tokens.TokenCreateResponse'
300          "500":
301            description: Internal Server Error
302            schema:
303              $ref: '#/definitions/tokens.TokenCreateResponse'
304        security:
305        - BasicAuth: []
306        summary: Create a token
307        tags:
308        - tokens
309    /users:
310      get:
311        consumes:
312        - application/json
313        description: Get all users
314        produces:
315        - application/json
316        responses:
317          "200":
318            description: OK
319            schema:
320              $ref: '#/definitions/users.UserListResponse'
321          "400":
322            description: Bad Request
323            schema:
324              $ref: '#/definitions/users.UserListResponse'
325          "404":
326            description: Not Found
327            schema:
328              $ref: '#/definitions/users.UserListResponse'
329          "500":
330            description: Internal Server Error
331            schema:
332              $ref: '#/definitions/users.UserListResponse'
333        security:
334        - BasicAuth: []
335        summary: List users
336        tags:
337        - users
338      post:
339        consumes:
340        - application/json
341        description: Add a new user
342        parameters:
343        - description: Add user
344          in: body
345          name: user
346          required: true
347          schema:
348            $ref: '#/definitions/users.UserCreateModel'
349        produces:
350        - application/json
351        responses:
352          "200":
353            description: OK
354            schema:
355              $ref: '#/definitions/users.UserCreateResponse'
356          "400":
357            description: Bad Request
358            schema:
359              $ref: '#/definitions/users.UserCreateResponse'
360          "404":
361            description: Not Found
362            schema:
363              $ref: '#/definitions/users.UserCreateResponse'
364          "500":
365            description: Internal Server Error
366            schema:
367              $ref: '#/definitions/users.UserCreateResponse'
368        security:
369        - BasicAuth: []
370        summary: Create a user
371        tags:
372        - users
373    /users/{id}:
374      get:
375        consumes:
376        - application/json
377        description: Get user by ID
378        parameters:
379        - description: User ID
380          in: path
381          name: id
382          required: true
383          type: string
384        produces:
385        - application/json
386        responses:
387          "200":
388            description: OK
389            schema:
390              $ref: '#/definitions/users.UserShowResponse'
391          "400":
392            description: Bad Request
393            schema:
394              $ref: '#/definitions/users.UserShowResponse'
395          "404":
396            description: Not Found
397            schema:
398              $ref: '#/definitions/users.UserShowResponse'
399          "500":
400            description: Internal Server Error
401            schema:
402              $ref: '#/definitions/users.UserShowResponse'
403        security:
404        - BasicAuth: []
405        summary: Show a user
406        tags:
407        - users
408      put:
409        consumes:
410        - application/json
411        description: Change an existing user
412        parameters:
413        - description: User ID
414          in: path
415          name: id
416          required: true
417          type: string
418        - description: Change user
419          in: body
420          name: user
421          required: true
422          schema:
423            $ref: '#/definitions/users.UserUpdateModel'
424        produces:
425        - application/json
426        responses:
427          "200":
428            description: OK
429            schema:
430              $ref: '#/definitions/users.UserUpdateResponse'
431          "400":
432            description: Bad Request
433            schema:
434              $ref: '#/definitions/users.UserUpdateResponse'
435          "404":
436            description: Not Found
437            schema:
438              $ref: '#/definitions/users.UserUpdateResponse'
439          "500":
440            description: Internal Server Error
441            schema:
442              $ref: '#/definitions/users.UserUpdateResponse'
443        security:
444        - BasicAuth: []
445        summary: Update a user
446        tags:
447        - users
448  produces:
449  - application/json
450  schemes:
451  - http
452  securityDefinitions:
453    BasicAuth:
454      type: basic
455  swagger: "2.0"