-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmicroservice-swagger.json
113 lines (113 loc) · 2.73 KB
/
microservice-swagger.json
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{
"swagger": "2.0",
"info": {
"description": "ClearScore Technical Test Microservice",
"version": "1.0",
"title": "ClearScore Technical Test"
},
"host": "localhost",
"basePath": "/",
"schemes": [
"http"
],
"paths": {
"/creditcards": {
"post": {
"summary": "Find credit cards user is eligible for",
"description": "Returns a list of credit cards that our partners have indicated the user is eligible to apply for.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CreditCardRequest"
}
}
],
"responses": {
"200": {
"description": "A sorted list of credit cards the user is eligible to apply for.",
"schema": {
"$ref": "#/definitions/CreditCardResponse"
}
},
"400": {
"description": "The request contained invalid parameters"
}
}
}
}
},
"definitions": {
"CreditCardRequest": {
"type": "object",
"required": [
"name",
"creditScore",
"salary"
],
"properties": {
"name": {
"type": "string",
"example": "John Smith",
"description": "Users full name"
},
"creditScore": {
"type": "integer",
"format": "int32",
"description": "Credit score between 0 and 700",
"minimum": 0,
"maximum": 700
},
"salary": {
"type": "integer",
"format": "int32",
"description": "Users annual salary",
"minimum": 0
}
}
},
"CreditCardResponse": {
"type": "array",
"items": {
"$ref": "#/definitions/CreditCard"
}
},
"CreditCard": {
"type": "object",
"required": [
"apr",
"name",
"provider",
"cardScore"
],
"properties": {
"provider": {
"type": "string",
"description": "Name of the partner that provides the credit card"
},
"name": {
"type": "string",
"description": "Name of the credit card product"
},
"apr": {
"type": "number",
"format": "double",
"description": "Annual percentage rate for the card"
},
"cardScore": {
"type": "number",
"format": "double",
"description": "The score given to the credit card based on the scoring algorithm"
}
}
}
}
}