Skip to content

Commit

Permalink
feat: upgrade openapi doc to v3.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod committed Apr 26, 2024
1 parent 5e38664 commit 2842fbd
Showing 1 changed file with 59 additions and 52 deletions.
111 changes: 59 additions & 52 deletions docs/http-api/swagger/authoritative-api-swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
swagger: '2.0'
openapi: 3.0.3
info:
version: "0.0.15"
title: PowerDNS Authoritative HTTP API
license:
name: MIT
basePath: /api/v1
consumes:
- application/json
produces:
- application/json
securityDefinitions:
# X-API-Key: abcdef12345
APIKeyHeader:
type: apiKey
in: header
name: X-API-Key
#basePath: /api/v1
#consumes:
# - application/json
#securityDefinitions:
# # X-API-Key: abcdef12345
# APIKeyHeader:
# type: apiKey
# in: header
# name: X-API-Key
security:
- APIKeyHeader: []

Expand All @@ -28,22 +26,30 @@ paths:
summary: Will always generate an error
operationId: error
responses: &commonErrors
'400':
"400":
description: The supplied request was not valid
schema:
$ref: '#/definitions/Error'
'404':
content:
application/json:
schema:
$ref: '#/definitions/Error'
"404":
description: Requested item was not found
schema:
$ref: '#/definitions/Error'
'422':
content:
application/json:
schema:
$ref: '#/definitions/Error'
"422":
description: The input to the operation was not valid
schema:
$ref: '#/definitions/Error'
'500':
content:
application/json:
schema:
$ref: '#/definitions/Error'
"500":
description: Internal server error
schema:
$ref: '#/definitions/Error'
content:
application/json:
schema:
$ref: '#/definitions/Error'

'/servers':
get:
Expand All @@ -52,7 +58,7 @@ paths:
tags:
- servers
responses:
'200':
"200":
description: An array of servers
schema:
type: array
Expand Down Expand Up @@ -163,7 +169,7 @@ paths:
'201':
description: A zone
schema:
$ref: '#/definitions/Zone'
$ref: '#/definitions/Zone'
<<: *commonErrors

'/servers/{server_id}/zones/{zone_id}':
Expand Down Expand Up @@ -448,9 +454,10 @@ paths:
schema:
type: array
items:
- $ref: '#/definitions/StatisticItem'
- $ref: '#/definitions/MapStatisticItem'
- $ref: '#/definitions/RingStatisticItem'
oneOf:
- $ref: '#/definitions/StatisticItem'
- $ref: '#/definitions/MapStatisticItem'
- $ref: '#/definitions/RingStatisticItem'
'422':
description: 'Returned when a non-existing statistic name has been requested. Contains an error message'
<<: *commonErrors
Expand Down Expand Up @@ -1148,18 +1155,18 @@ definitions:
readOnly: true

Autoprimary:
title: Autoprimary server
description: An autoprimary server that can provision new domains.
properties:
ip:
type: string
description: "IP address of the autoprimary server"
nameserver:
type: string
description: "DNS name of the autoprimary server"
account:
type: string
description: "Account name for the autoprimary server"
title: Autoprimary server
description: An autoprimary server that can provision new domains.
properties:
ip:
type: string
description: "IP address of the autoprimary server"
nameserver:
type: string
description: "DNS name of the autoprimary server"
account:
type: string
description: "Account name for the autoprimary server"

ConfigSetting:
title: ConfigSetting
Expand All @@ -1179,11 +1186,11 @@ definitions:
type: object
properties:
name:
type: string
description: 'Item name'
type: string
description: 'Item name'
value:
type: string
description: 'Item value'
type: string
description: 'Item value'

StatisticItem:
title: StatisticItem
Expand Down Expand Up @@ -1278,14 +1285,14 @@ definitions:
zone:
type: string

# FIXME: This is problematic at the moment, because swagger doesn't support this type of mixed response
# SearchResult:
# anyOf:
# - $ref: '#/definitions/SearchResultZone'
# - $ref: '#/definitions/SearchResultRecord'
# - $ref: '#/definitions/SearchResultComment'
# FIXME: This is problematic at the moment, because swagger doesn't support this type of mixed response
# SearchResult:
# anyOf:
# - $ref: '#/definitions/SearchResultZone'
# - $ref: '#/definitions/SearchResultRecord'
# - $ref: '#/definitions/SearchResultComment'

# Since we can't do 'anyOf' at the moment, we create a 'superset object'
# Since we can't do 'anyOf' at the moment, we create a 'superset object'
SearchResult:
title: SearchResult
properties:
Expand Down

0 comments on commit 2842fbd

Please sign in to comment.