Skip to content

[docs-agent] Add networks example on Portfolio by-address requests - #1653

Merged
brianluong merged 3 commits into
mainfrom
docs/portfolio-networks-examples-not-defaults
Sep 25, 2026
Merged

brianluong merged 3 commits into
mainfrom
docs/portfolio-networks-examples-not-defaults

Conversation

@alchemy-bot

@alchemy-bot alchemy-bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to PR #1649. That PR removed the array-level default: [eth-mainnet, base-mainnet, matic-mainnet] on four Portfolio networks fields because the API has no such server-side default (networks is required). Removing it also dropped the sample values renderers used to pre-populate the schema tables and playground forms.

Per the Slack thread discussion — default: should describe the actual API default, example: is what the playground uses to pre-populate — this PR re-adds the same three networks as example: in two places:

Schema-level example: on the four shared request schemas (drives Redocly's schema-table "Example" column):

  • AddressItem.networks — backs get-tokens-by-address (via ByAddressRequestWithOptions).
  • AddressItemForNFTOwnership.networks — backs get-nfts-by-address and get-nft-contracts-by-address (via ByAddressRequestWithNFTOptionsAndPaging).
  • AddressItemWith20Maximum.networks — backs get-token-balances-by-address (via ByAddressRequestWith3PairsAnd20Networks).
  • TransfersByAddressRequest.networks — backs get-transfers-by-address.

Inline requestBody.example: on all five endpoint files (drives the Try It playground pre-population, one entry per endpoint):

  • assets/tokens/by-address.yaml — already had one (unchanged, still shows the 3 networks).
  • assets/tokens/balances/by-address.yaml — already had one (unchanged).
  • transfers/by-address.yaml — already had one (unchanged).
  • assets/nfts/by-address.yaml — NEW inline example added to match the pattern.
  • assets/nfts/contracts/by-address.yaml — NEW inline example added to match the pattern.

Left untouched:

Semantics net: no default: anywhere on the touched fields (matches API reality — networks is required), and all five endpoints now have BOTH a schema-level example: (for schema tables) AND an inline requestBody example: (for playground pre-population) with the same three-network sample.

Validated with pnpm run validate:rest — 0 errors on the portfolio spec.

Requested by

@dslovinsky (via Slack thread — initial design decision to switch default: → example:)
@brianluong (via Slack thread — follow-up to ensure all five endpoint files carry an explicit inline example)

Re-add [eth-mainnet, base-mainnet, matic-mainnet] on the four AddressItem*/TransfersByAddressRequest networks fields as schema-level example: instead of default:. Per OpenAPI semantics default: describes the actual API default (which does not exist here — networks is required) while example: is the sample value renderers and playgrounds use to pre-populate. This restores the sample-value UX that PR #1649 dropped without falsely implying a server-side default.

Requested-by: @dslovinsky
@alchemy-bot
alchemy-bot requested a review from a team as a code owner September 24, 2026 18:48
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

🔗 Preview Mode

Name Status Preview Updated (UTC)
Alchemy Docs ✅ Ready 🔗 Visit Preview Sep 25, 2026, 4:10 PM

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f63575b53

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

example:
- eth-mainnet
- base-mainnet
- matic-mainnet

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Replace matic-mainnet with the supported Polygon slug

For both NFT-by-address operations, this schema-level example becomes the pre-populated networks value, but AddressItemForNFTOwnership.networks references nftNetworks, whose enum includes polygon-mainnet and not matic-mainnet. Submitting the generated example therefore violates the documented request schema; use polygon-mainnet here (while retaining matic-mainnet for the token and transfers schemas that accept it).

Useful? React with 👍 / 👎.

The three other Portfolio by-address endpoints (get-tokens-by-address, get-token-balances-by-address, get-transfers-by-address) already carry an inline requestBody example: block that pre-populates the playground with the 3-network sample. The NFT endpoints (get-nfts-by-address, get-nft-contracts-by-address) previously relied on the shared schema alone, which meant the schema-level networks example added earlier in this PR was the only source of the sample value on those two pages. Adding matching inline examples so all five endpoints have an explicit requestBody example and the playground pre-population path is consistent across the whole Portfolio surface.

Requested-by: @brianluong
brianluong
brianluong previously approved these changes Sep 24, 2026
@github-actions
github-actions Bot dismissed brianluong’s stale review September 24, 2026 19:30

@brianluong you are listed as the originator of this docs request (via the Requested-by trailer on a docs-agent commit). Per the docs-agent self-review policy, the originator can't approve their own request. Please ask another team member to review.

@brianluong
brianluong merged commit b4903bb into main Sep 25, 2026
14 checks passed
@brianluong
brianluong deleted the docs/portfolio-networks-examples-not-defaults branch September 25, 2026 16:28
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.

4 participants