Skip to content
Snippets Groups Projects

feat: Add missing components to spec

1 file
+ 75
39
Compare changes
  • Side-by-side
  • Inline
+ 75
39
@@ -7,10 +7,11 @@ info:
license:
name: Eclipse Public License - 2.0
url: https://www.eclipse.org/legal/epl-2.0/
servers:
- url: http://api.eclipse.org/geoip
description: Production endpoint for Eclipse GeoIP REST API
- url: http://api.eclipse.org/geoip
description: Production endpoint for Eclipse GeoIP REST API
paths:
/cities/{ipAddr}:
description: >
@@ -18,12 +19,12 @@ paths:
get:
summary: Get city
parameters:
- name: ipAddr
in: path
required: true
description: a valid IP address to retrieve the city of origin for.
schema:
type: string
- name: ipAddr
in: path
required: true
description: a valid IP address to retrieve the city of origin for.
schema:
type: string
responses:
200:
description: OK
@@ -31,30 +32,50 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/City"
400:
description: Bad Request - Invalid IP
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
500:
description: Server Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/countries/{ipAddr}:
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.
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.
get:
summary: Get country
parameters:
- name: ipAddr
in: path
required: true
description: a valid IP address to retrieve the country of origin for.
schema:
type: string
- name: ipAddr
in: path
required: true
description: a valid IP address to retrieve the country of origin for.
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Country"
$ref: "#/components/schemas/Country"
400:
description: Bad Request - Invalid IP
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
500:
description: Server Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/subnets/{ipv}/{isoCountry}:
description: >
@@ -62,31 +83,31 @@ paths:
get:
summary: Get IP ranges for country code
parameters:
- name: ipv
in: path
required: true
description: Which list of subnets to retrieve IP ranges for.
schema:
type: string
enum: ['ipv4','ipv6']
- name: isoCountry
in: path
required: true
description: The 2 letter ISO code for the country to retrieve (case-insensitive).
schema:
type: string
minLength: 2
maxLength: 2
- name: ipv
in: path
required: true
description: Which list of subnets to retrieve IP ranges for.
schema:
type: string
enum: ["ipv4", "ipv6"]
- name: isoCountry
in: path
required: true
description: The 2 letter ISO code for the country to retrieve (case-insensitive).
schema:
type: string
minLength: 2
maxLength: 2
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/IpAddresses"
$ref: "#/components/schemas/IpAddresses"
500:
description: Server Error
components:
schemas:
Country:
@@ -97,7 +118,7 @@ components:
description: The MaxMind API unique ID for a geographic location.
iso_code:
type: string
description: The 2 letter ISO code for the current country.
description: The 2 letter ISO code for the current country.
names:
type: object
description: The locale of the country name.
@@ -110,6 +131,7 @@ components:
is_in_european_union:
type: boolean
description: TRUE if the current country is in the European Union, and false otherwise.
City:
type: object
properties:
@@ -125,11 +147,25 @@ components:
example:
en: Ottawa
"pt-BR": "Otava"
IpAddresses:
type: array
items:
type: string
description: IP ranges with subnet mask that are from the given country.
example: "192.168.1.0/24"
\ No newline at end of file
Error:
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
Loading