Skip to content

Commit

Permalink
Merge pull request #170 from ethereum/mpetrunic/ssz-version
Browse files Browse the repository at this point in the history
Add version header for ssz responses
  • Loading branch information
mpetrunic authored Oct 15, 2021
2 parents f68bba8 + 29247a9 commit b943ca3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apis/beacon/blocks/block.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ get:
responses:
"200":
description: "Successful response"
headers:
Eth-Consensus-Version:
$ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version'
content:
application/json:
schema:
Expand All @@ -29,6 +32,7 @@ get:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Altair.SignedBeaconBlock"
application/octet-stream:
schema:

description: "SSZ serialized block bytes. Use Accept header to choose this response type"
"400":
description: "The block ID supplied could not be parsed"
Expand Down
3 changes: 3 additions & 0 deletions apis/debug/state.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ get:
responses:
"200":
description: Success
headers:
Eth-Consensus-Version:
$ref: '../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version'
content:
application/json:
schema:
Expand Down
8 changes: 8 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,11 @@ components:
$ref: './types/http.yaml#/InternalError'
CurrentlySyncing:
$ref: './types/http.yaml#/CurrentlySyncing'

headers:
Eth-Consensus-Version:
description: Required in response so client can deserialize returned json or ssz data more effectively.
schema:
type: string
enum: [phase0, altair]
example: "phase0"

0 comments on commit b943ca3

Please sign in to comment.