Skip to content
Snippets Groups Projects
Commit a2fef15f authored by Martin Lowe's avatar Martin Lowe :flag_ca:
Browse files

Merge branch 'zacharysabourin/master/23' into 'master'

feat: Add missing components to spec

Closes #23

See merge request !31
parents 62bae17c 64bf9ea8
No related branches found
No related tags found
1 merge request!31feat: Add missing components to spec
Pipeline #13928 failed
...@@ -7,10 +7,11 @@ info: ...@@ -7,10 +7,11 @@ info:
license: license:
name: Eclipse Public License - 2.0 name: Eclipse Public License - 2.0
url: https://www.eclipse.org/legal/epl-2.0/ url: https://www.eclipse.org/legal/epl-2.0/
servers: servers:
- url: http://api.eclipse.org/geoip - url: http://api.eclipse.org/geoip
description: Production endpoint for Eclipse GeoIP REST API description: Production endpoint for Eclipse GeoIP REST API
paths: paths:
/cities/{ipAddr}: /cities/{ipAddr}:
description: > description: >
...@@ -18,12 +19,12 @@ paths: ...@@ -18,12 +19,12 @@ paths:
get: get:
summary: Get city summary: Get city
parameters: parameters:
- name: ipAddr - name: ipAddr
in: path in: path
required: true required: true
description: a valid IP address to retrieve the city of origin for. description: a valid IP address to retrieve the city of origin for.
schema: schema:
type: string type: string
responses: responses:
200: 200:
description: OK description: OK
...@@ -31,30 +32,50 @@ paths: ...@@ -31,30 +32,50 @@ paths:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/City" $ref: "#/components/schemas/City"
400:
description: Bad Request - Invalid IP
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
500: 500:
description: Server Error description: Server Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/countries/{ipAddr}: /countries/{ipAddr}:
description: > description: >
Retrieves country data for a given IP address in either IPv4 or IPv6 format. In cases where blacklisted IP's are sent (such as local addresses, or addresses outside of range), a server error is returned. Retrieves country data for a given IP address in either IPv4 or IPv6 format. In cases where blacklisted IP's are sent (such as local addresses, or addresses outside of range), a server error is returned.
get: get:
summary: Get country summary: Get country
parameters: parameters:
- name: ipAddr - name: ipAddr
in: path in: path
required: true required: true
description: a valid IP address to retrieve the country of origin for. description: a valid IP address to retrieve the country of origin for.
schema: schema:
type: string type: string
responses: responses:
200: 200:
description: OK description: OK
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Country" $ref: "#/components/schemas/Country"
400:
description: Bad Request - Invalid IP
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
500: 500:
description: Server Error description: Server Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/subnets/{ipv}/{isoCountry}: /subnets/{ipv}/{isoCountry}:
description: > description: >
...@@ -62,31 +83,31 @@ paths: ...@@ -62,31 +83,31 @@ paths:
get: get:
summary: Get IP ranges for country code summary: Get IP ranges for country code
parameters: parameters:
- name: ipv - name: ipv
in: path in: path
required: true required: true
description: Which list of subnets to retrieve IP ranges for. description: Which list of subnets to retrieve IP ranges for.
schema: schema:
type: string type: string
enum: ['ipv4','ipv6'] enum: ["ipv4", "ipv6"]
- name: isoCountry - name: isoCountry
in: path in: path
required: true required: true
description: The 2 letter ISO code for the country to retrieve (case-insensitive). description: The 2 letter ISO code for the country to retrieve (case-insensitive).
schema: schema:
type: string type: string
minLength: 2 minLength: 2
maxLength: 2 maxLength: 2
responses: responses:
200: 200:
description: OK description: OK
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/IpAddresses" $ref: "#/components/schemas/IpAddresses"
500: 500:
description: Server Error description: Server Error
components: components:
schemas: schemas:
Country: Country:
...@@ -97,7 +118,7 @@ components: ...@@ -97,7 +118,7 @@ components:
description: The MaxMind API unique ID for a geographic location. description: The MaxMind API unique ID for a geographic location.
iso_code: iso_code:
type: string type: string
description: The 2 letter ISO code for the current country. description: The 2 letter ISO code for the current country.
names: names:
type: object type: object
description: The locale of the country name. description: The locale of the country name.
...@@ -110,6 +131,7 @@ components: ...@@ -110,6 +131,7 @@ components:
is_in_european_union: is_in_european_union:
type: boolean type: boolean
description: TRUE if the current country is in the European Union, and false otherwise. description: TRUE if the current country is in the European Union, and false otherwise.
City: City:
type: object type: object
properties: properties:
...@@ -125,11 +147,25 @@ components: ...@@ -125,11 +147,25 @@ components:
example: example:
en: Ottawa en: Ottawa
"pt-BR": "Otava" "pt-BR": "Otava"
IpAddresses: IpAddresses:
type: array type: array
items: items:
type: string type: string
description: IP ranges with subnet mask that are from the given country. description: IP ranges with subnet mask that are from the given country.
example: "192.168.1.0/24" example: "192.168.1.0/24"
Error:
\ No newline at end of file type: object
properties:
status_code:
type: integer
description: HTTP response code
message:
type: string
description: Message containing error information
url:
type:
- string
- "null"
description: The URL
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment