Skip to content

Fix/Improve OpenRPC parser display#2136

Merged
bgravenorst merged 21 commits into
mainfrom
parser-display
Jul 14, 2025
Merged

Fix/Improve OpenRPC parser display#2136
bgravenorst merged 21 commits into
mainfrom
parser-display

Conversation

@bgravenorst

@bgravenorst bgravenorst commented Jul 4, 2025

Copy link
Copy Markdown
Contributor

Description

Fixes to improve the display of Parameters and Returns sections in the autogenerated API docs.

These include:

  1. Add missing css styles for patterns
  2. Hide the expand box for simple arrays (strings, integers, etc), in most cases it didn’t add value and used up valuable space. We’ll need to improve our array descriptions though.
  3. Add descriptive array types. E.g, instead of "arrays", say "array of objects", "multidimensional array", "array of strings", etc
  4. The text “required” has been removed for the Returns section as it’s not needed
  5. Update how enums are displayed. Now appears next to the type information. Making it easier to see the options without having to read through the description.
  6. Update Pattern to be compact and inline with type and required meta.
  7. Flatten descriptions for array of object types. For example, notice wallet_getcallsstatus receipts return type. You’ll see multiple redundant wrappers which are now flattened. Same for accessList in Linea's eth_call.
  8. Flatten return results that contain either a null response or block/Transaction information to only show the relevant block/transaction information. This removes a level of indentation. Our descriptions should clearly call out null as a possible return type if not found anyway.
  9. Fix an issue (in Linea) when an object has both oneOf AND properties, we only render the oneOf options and completely skip the properties. For example the Full transactions return parameters in eth_getBlockByHash.
  10. Fix a parser issue that prevented the transaction information from display for Linea's eth_getTransaction... methods.
  11. Increase visibility of the parameter drop-down, and decreased padding around it.
  12. Add the ability to use a local JSON-RPC spec in the Services section. For example:
    <ParserOpenRPC
      network={NETWORK_NAMES.linea}
      method="eth_getTransactionByBlockHashAndIndex"
      src="local"
    />
    
  13. Update extraContent prop with targeted injection points (after-summary, after-description, after-parameters, after-returns, after-errors). This allows custom content like constraints, examples, or additional documentation to be seamlessly integrated at specific locations within the auto-generated API documentation. See:
    https://metamask-docs-git-parser-display-consensys-ddffed67.vercel.app/services/reference/linea/json-rpc-methods/eth_getlogs/

Preview

Checklist

Complete this checklist before merging your PR:

  • If this PR contains a major change to the documentation content, I have added an entry to the top of the "What's new?" page.
  • The proposed changes have been reviewed and approved by a member of the documentation team.

@bgravenorst bgravenorst requested review from a team as code owners July 4, 2025 02:28
@vercel

vercel Bot commented Jul 4, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
metamask-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 14, 2025 10:41pm

@bgravenorst bgravenorst marked this pull request as draft July 4, 2025 02:29
cursor[bot]

This comment was marked as outdated.

Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
…tions.

Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
…ying results. Parser issue.

Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
cursor[bot]

This comment was marked as outdated.

Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
alexandratran
alexandratran previously approved these changes Jul 14, 2025
Comment thread src/components/ParserOpenRPC/DetailsBox/styles.module.scss
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
cursor[bot]

This comment was marked as outdated.

@bgravenorst bgravenorst merged commit ab18297 into main Jul 14, 2025
19 checks passed
@bgravenorst bgravenorst deleted the parser-display branch July 14, 2025 22:47
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