Skip to content

Add a plugin to make SSZ request body description visible - #632

Merged
nflaig merged 2 commits into
ethereum:masterfrom
syjn99:feat/visible-ssz-request-body
Aug 7, 2026
Merged

Add a plugin to make SSZ request body description visible#632
nflaig merged 2 commits into
ethereum:masterfrom
syjn99:feat/visible-ssz-request-body

Conversation

@syjn99

@syjn99 syjn99 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This is sort of hacky way to render a description for SSZ request body via Swagger UI. This covers all 9 octet-stream request bodies at once:

  • POST /eth/v2/beacon/blinded_blocks
  • POST /eth/v2/beacon/blocks
  • POST /eth/v1/beacon/execution_payload_bids
  • POST /eth/v1/beacon/execution_payload_envelopes
  • POST /eth/v2/beacon/pool/attestations
  • POST /eth/v1/beacon/pool/payload_attestations
  • POST /eth/v2/validator/aggregate_and_proofs
  • POST /eth/v1/validator/register_validator
  • POST /eth/v1/validator/proposer_preferences

Example:

image

Today it just shows like

Example values are not available for application/octet-stream media types.

@nflaig nflaig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @syjn99 this is great, did you make sure this doesn't break anything else, that would be my worry when adding such a plugin

Comment thread index.html Outdated
RequestBody: (Original, system) => (props) => {
const React = system.React
const contentType = props.contentType || ""
const isBinaryMediaType = ["application/octet-stream", "image/", "audio/", "video/"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"image/", "audio/", "video/" why do we need these?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified in 13b98c8

Rename isBinaryMediaType to isOctetStreamType and drop the single-element
array, since only application/octet-stream is checked.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@syjn99

syjn99 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

thanks @syjn99 this is great, did you make sure this doesn't break anything else, that would be my worry when adding such a plugin

Yes I believe it is a hacky way but this should not affect other parts of UI as it additionally renders one more component when RequestBody is present.

@syjn99
syjn99 requested a review from nflaig August 6, 2026 12:56

@nflaig nflaig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nflaig
nflaig merged commit 95b9faf into ethereum:master Aug 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants