Commit b175f97c authored by Peter Mrekaj's avatar Peter Mrekaj Committed by GitHub

Fix OpenAPI specification inconsistencies (#1614)

Several inconsistencies declared in the pins and stamps endpoints
of the OpenAPI specification and the bee API server implementation
are removed. On top of that also fixes several declaration errors.
parent 631c8d8a
...@@ -129,7 +129,7 @@ jobs: ...@@ -129,7 +129,7 @@ jobs:
timeout 10m ./beeinfra.sh install --local -r "${REPLICA}" --geth --k3s --pay-threshold 1000000000000 --postage --db-capacity 100 timeout 10m ./beeinfra.sh install --local -r "${REPLICA}" --geth --k3s --pay-threshold 1000000000000 --postage --db-capacity 100
- name: Test gc - name: Test gc
id: gc-chunk-1 id: gc-chunk-1
run: ./beekeeper check gc --db-capacity 100 --reserve --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --wait 15s run: ./beekeeper check gc --cache-capacity 100 --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
- name: Destroy the cluster - name: Destroy the cluster
run: | run: |
./beeinfra.sh uninstall ./beeinfra.sh uninstall
......
...@@ -19,7 +19,7 @@ servers: ...@@ -19,7 +19,7 @@ servers:
default: "localhost" default: "localhost"
description: Base address of the local bee node main API description: Base address of the local bee node main API
port: port:
default: 1633 default: "1633"
description: Service port provided in bee node config description: Service port provided in bee node config
- url: "http://{apiRoot}:{port}" - url: "http://{apiRoot}:{port}"
variables: variables:
...@@ -27,7 +27,7 @@ servers: ...@@ -27,7 +27,7 @@ servers:
default: "localhost" default: "localhost"
description: Base address of the local bee node main API description: Base address of the local bee node main API
port: port:
default: 1633 default: "1633"
description: Service port provided in bee node config description: Service port provided in bee node config
paths: paths:
...@@ -445,7 +445,7 @@ paths: ...@@ -445,7 +445,7 @@ paths:
- in: path - in: path
name: address name: address
schema: schema:
$ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress" $ref: "SwarmCommon.yaml#/components/schemas/SwarmOnlyReference"
required: true required: true
description: Swarm address of the root hash description: Swarm address of the root hash
post: post:
...@@ -463,8 +463,8 @@ paths: ...@@ -463,8 +463,8 @@ paths:
$ref: "SwarmCommon.yaml#/components/responses/400" $ref: "SwarmCommon.yaml#/components/responses/400"
"403": "403":
$ref: "SwarmCommon.yaml#/components/responses/403" $ref: "SwarmCommon.yaml#/components/responses/403"
"404": "500":
$ref: "SwarmCommon.yaml#/components/responses/404" $ref: "SwarmCommon.yaml#/components/responses/500"
default: default:
description: Default response description: Default response
delete: delete:
...@@ -482,8 +482,8 @@ paths: ...@@ -482,8 +482,8 @@ paths:
$ref: "SwarmCommon.yaml#/components/responses/400" $ref: "SwarmCommon.yaml#/components/responses/400"
"403": "403":
$ref: "SwarmCommon.yaml#/components/responses/403" $ref: "SwarmCommon.yaml#/components/responses/403"
"404": "500":
$ref: "SwarmCommon.yaml#/components/responses/404" $ref: "SwarmCommon.yaml#/components/responses/500"
default: default:
description: Default response description: Default response
get: get:
...@@ -496,9 +496,13 @@ paths: ...@@ -496,9 +496,13 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "SwarmCommon.yaml#/components/schemas/PinningState" $ref: "SwarmCommon.yaml#/components/schemas/SwarmOnlyReference"
"400":
$ref: "SwarmCommon.yaml#/components/responses/400"
"403": "403":
$ref: "SwarmCommon.yaml#/components/responses/403" $ref: "SwarmCommon.yaml#/components/responses/403"
"404":
$ref: "SwarmCommon.yaml#/components/responses/404"
"500": "500":
$ref: "SwarmCommon.yaml#/components/responses/500" $ref: "SwarmCommon.yaml#/components/responses/500"
default: default:
...@@ -515,7 +519,7 @@ paths: ...@@ -515,7 +519,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "SwarmCommon.yaml#/components/schemas/BzzChunksPinned" $ref: "SwarmCommon.yaml#/components/schemas/SwarmOnlyReferencesList"
"403": "403":
$ref: "SwarmCommon.yaml#/components/responses/403" $ref: "SwarmCommon.yaml#/components/responses/403"
"500": "500":
...@@ -725,6 +729,13 @@ paths: ...@@ -725,6 +729,13 @@ paths:
description: Default response description: Default response
"/stamps/{id}": "/stamps/{id}":
parameters:
- in: path
name: id
schema:
$ref: "SwarmCommon.yaml#/components/schemas/BatchID"
required: true
description: Swarm address of the stamp
get: get:
summary: Get an individual postage batch status summary: Get an individual postage batch status
tags: tags:
...@@ -735,7 +746,7 @@ paths: ...@@ -735,7 +746,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "SwarmCommon.yaml#/components/schemas/PostageBatchResponse" $ref: "SwarmCommon.yaml#/components/schemas/PostageBatch"
"400": "400":
$ref: "SwarmCommon.yaml#/components/responses/400" $ref: "SwarmCommon.yaml#/components/responses/400"
default: default:
...@@ -749,17 +760,20 @@ paths: ...@@ -749,17 +760,20 @@ paths:
parameters: parameters:
- in: path - in: path
name: amount name: amount
type: integer schema:
type: integer
required: true required: true
description: Amount added to the balance description: Amount added to the balance
- in: path - in: path
name: depth name: depth
type: integer schema:
type: integer
required: true required: true
description: Batch depth. Must be higher than default bucket depth (16) description: Batch depth. Must be higher than default bucket depth (16)
- in: query - in: query
name: label name: label
type: string schema:
type: string
required: false required: false
description: An optional label for this batch description: An optional label for this batch
responses: responses:
...@@ -773,6 +787,6 @@ paths: ...@@ -773,6 +787,6 @@ paths:
$ref: "SwarmCommon.yaml#/components/responses/400" $ref: "SwarmCommon.yaml#/components/responses/400"
"500": "500":
$ref: "SwarmCommon.yaml#/components/responses/500" $ref: "SwarmCommon.yaml#/components/responses/500"
default: default:
description: Default response description: Default response
...@@ -237,14 +237,6 @@ components: ...@@ -237,14 +237,6 @@ components:
items: items:
$ref: "#/components/schemas/Address" $ref: "#/components/schemas/Address"
PinningState:
type: object
properties:
address:
$ref: "#/components/schemas/SwarmAddress"
pinCounter:
type: integer
PssRecipient: PssRecipient:
type: string type: string
...@@ -263,11 +255,6 @@ components: ...@@ -263,11 +255,6 @@ components:
reference: reference:
$ref: "#/components/schemas/SwarmReference" $ref: "#/components/schemas/SwarmReference"
PostageBatchResponse:
type: object
properties:
$ref: "#/components/schemas/PostageBatch"
PostageBatchesResponse: PostageBatchesResponse:
type: object type: object
properties: properties:
...@@ -278,7 +265,7 @@ components: ...@@ -278,7 +265,7 @@ components:
type: object type: object
properties: properties:
batchID: batchID:
$ref: "#/components/schemas/SwarmAddress" $ref: "#/components/schemas/BatchID"
Response: Response:
type: object type: object
...@@ -304,7 +291,7 @@ components: ...@@ -304,7 +291,7 @@ components:
type: object type: object
properties: properties:
batchID: batchID:
$ref: "#/components/schemas/SwarmAddress" $ref: "#/components/schemas/BatchID"
utilization: utilization:
type: integer type: integer
...@@ -356,11 +343,23 @@ components: ...@@ -356,11 +343,23 @@ components:
pattern: '^[A-Za-z0-9]+\.[A-Za-z0-9]+$' pattern: '^[A-Za-z0-9]+\.[A-Za-z0-9]+$'
example: "swarm.eth" example: "swarm.eth"
BatchID:
pattern: "^[A-Fa-f0-9]{64}$"
example: "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
SwarmOnlyReference: SwarmOnlyReference:
oneOf: oneOf:
- $ref: "#/components/schemas/SwarmAddress" - $ref: "#/components/schemas/SwarmAddress"
- $ref: "#/components/schemas/SwarmEncryptedReference" - $ref: "#/components/schemas/SwarmEncryptedReference"
SwarmOnlyReferencesList:
type: object
properties:
addresses:
type: array
items:
$ref: "#/components/schemas/SwarmOnlyReference"
SwarmReference: SwarmReference:
oneOf: oneOf:
- $ref: "#/components/schemas/SwarmAddress" - $ref: "#/components/schemas/SwarmAddress"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment