-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathswagger.yml
77 lines (77 loc) · 1.79 KB
/
swagger.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
swagger: '2.0'
info:
title: resolve-ip
description: service that takes in an IP address and converts it to a latitude and longitude
# when changing the version here, make sure to
# 1. re-run `make generate` to generate clients and server
# 2. commit the new clients, and tag the commit with the version:
# git tag -a vX.Y.Z -m "vX.Y.Z"
# git push origin --tags
version: 4.2.0
x-npm-package: resolve-ip
schemes:
- http
produces:
- application/json
responses:
BadRequest:
description: "Bad Request"
schema:
$ref: "#/definitions/BadRequest"
InternalError:
description: "Internal Error"
schema:
$ref: "#/definitions/InternalError"
paths:
/healthcheck:
get:
operationId: healthCheck
description: Checks if the service is healthy
responses:
200:
description: OK response
/ip/{ip}:
get:
operationId: locationForIP
description: Gets the lat/lon for a given IP.
parameters:
- name: ip
in: path
description: The IP to try to locate
required: true
type: string
responses:
200:
description: Successfully found a location for the given IP
schema:
$ref: '#/definitions/IP'
404:
description: Was not able to determine the location for the given IP
schema:
$ref: '#/definitions/NotFound'
definitions:
IP:
type: object
properties:
lat:
type: number
lon:
type: number
required:
- lat
- lon
InternalError:
type: object
properties:
message:
type: string
BadRequest:
type: object
properties:
message:
type: string
NotFound:
type: object
properties:
message:
type: string