-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathrating-openapi-spec.yml
More file actions
98 lines (97 loc) · 2.71 KB
/
rating-openapi-spec.yml
File metadata and controls
98 lines (97 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
openapi: 3.0.2
info:
title: RatingService API Specification
description: 'This API server exposes required endpoints for managing book ratings in Microservices reference application.'
termsOfService: https://www.anitechcs.com/terms-condition/
contact:
email: contact@anitechcs.com
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: v1.0.0
externalDocs:
description: Find out more about Microservices reference application
url: https://github.com/anitechcs/microservices-reference-application
servers:
- url: 'https://mra-bookstore.tk/v1'
description: Rating Service production server
tags:
- name: Rating-Service
description: Rating service enpoints required for Microservices reference application
components:
schemas:
Rating:
type: object
properties:
rating:
description: Average rating
type: number
format: float
maximum: 5
example: 4.5
ratingCount:
description: Total number of rating count
type: integer
format: int64
example: 350
RatingSuccessResponse:
type: object
properties:
statusCode:
type: integer
format: int32
message:
type: string
ratings:
$ref: '#/components/schemas/Rating'
RatingErrorResponse:
type: object
properties:
statusCode:
description: Non zero error code
type: integer
format: int32
message:
description: Error message
type: string
paths:
/rating/{bookId}:
description: Rating service
get:
tags:
- Rating-Service
description: Returns ratings for a particulat book
operationId: getBookRatings
parameters:
- name: bookId
in: path
description: Id of book to return ratings
required: true
schema:
type: integer
format: int64
responses:
200:
description: Success response
content:
application/json:
schema:
$ref: '#/components/schemas/RatingSuccessResponse'
400:
description: Client error
content:
application/json:
schema:
$ref: '#/components/schemas/RatingErrorResponse'
404:
description: No records found
content:
application/json:
schema:
$ref: '#/components/schemas/RatingErrorResponse'
500:
description: Server error
content:
application/json:
schema:
$ref: '#/components/schemas/RatingErrorResponse'