Skip to content

Commit

Permalink
Add 415 response as a reason to fail POSTs. (ethereum#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfyone authored Oct 27, 2022
1 parent eaa6085 commit e192da4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apis/beacon/blocks/blinded_blocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ post:
example:
code: 400
message: "Invalid block: missing signature"
"415":
$ref: '../../../beacon-node-oapi.yaml#/components/responses/UnsupportedMediaType'
"500":
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError'
"503":
Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/blocks/blocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ post:
- example:
code: 400
message: "Invalid block: missing signature"
"415":
$ref: '../../../beacon-node-oapi.yaml#/components/responses/UnsupportedMediaType'
"500":
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError'
"503":
Expand Down
2 changes: 2 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ components:
$ref: './types/http.yaml#/InvalidRequest'
NotFound:
$ref: './types/http.yaml#/NotFound'
UnsupportedMediaType:
$ref: './types/http.yaml#/UnsupportedMediaType'
InternalError:
$ref: './types/http.yaml#/InternalError'
CurrentlySyncing:
Expand Down
22 changes: 22 additions & 0 deletions types/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,28 @@ NotFound:
example:
code: 404
message: "Requested item not found"
UnsupportedMediaType:
description: "The supplied content-type is not supported."
content:
application/json:
schema:
type: object
properties:
code:
description: "The media type supplied is unsupported, and the request has been rejected. This occurs when a HTTP request supplies a payload in a content-type that the service is not able to accept."
type: number
example: 415
message:
description: "Message describing error"
type: string
stacktraces:
description: "Optional stacktraces, sent when node is in debug mode"
type: array
items:
type: string
example:
code: 415
message: "Cannot read the supplied content type."
ErrorMessage:
type: object
properties:
Expand Down

0 comments on commit e192da4

Please sign in to comment.