-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpromotion-openapi-spec.yml
95 lines (94 loc) · 2.71 KB
/
promotion-openapi-spec.yml
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
openapi: 3.0.2
info:
title: PromotionService API Specification
description: 'This API server exposes required endpoints for managing book promotions 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: Promotion Service production server
tags:
- name: Promotion-Service
description: Promotion service enpoints required for Microservices reference application
components:
schemas:
Promotion:
type: object
properties:
text:
description: Text to show in promotion
type: string
example: '15% off'
color:
description: Hex code for the Color
type: string
example: '#0D47A1'
PromotionSuccessResponse:
type: object
properties:
statusCode:
type: integer
format: int32
message:
type: string
promotions:
$ref: '#/components/schemas/Promotion'
PromotionErrorResponse:
type: object
properties:
statusCode:
description: Non zero error code
type: integer
format: int32
message:
description: Error message
type: string
paths:
/promotion/{bookId}:
description: Promotion service
get:
tags:
- Promotion-Service
description: Returns promo details for a particulat book
operationId: getBookPromotions
parameters:
- name: bookId
in: path
description: Id of book to return promotions
required: true
schema:
type: integer
format: int64
responses:
200:
description: Success response
content:
application/json:
schema:
$ref: '#/components/schemas/PromotionSuccessResponse'
400:
description: Client error
content:
application/json:
schema:
$ref: '#/components/schemas/PromotionErrorResponse'
404:
description: No records found
content:
application/json:
schema:
$ref: '#/components/schemas/PromotionErrorResponse'
500:
description: Server error
content:
application/json:
schema:
$ref: '#/components/schemas/PromotionErrorResponse'