[docs-agent] Add networks example on Portfolio by-address requests - #1653
Conversation
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
🔗 Preview Mode
|
There was a problem hiding this comment.
💡 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 |
There was a problem hiding this comment.
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 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.
Summary
Follow-up to PR #1649. That PR removed the array-level
default: [eth-mainnet, base-mainnet, matic-mainnet]on four Portfolionetworksfields because the API has no such server-side default (networksis 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 asexample:in two places:Schema-level
example:on the four shared request schemas (drives Redocly's schema-table "Example" column):AddressItem.networks— backsget-tokens-by-address(viaByAddressRequestWithOptions).AddressItemForNFTOwnership.networks— backsget-nfts-by-addressandget-nft-contracts-by-address(viaByAddressRequestWithNFTOptionsAndPaging).AddressItemWith20Maximum.networks— backsget-token-balances-by-address(viaByAddressRequestWith3PairsAnd20Networks).TransfersByAddressRequest.networks— backsget-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:
AddressItemTransactionHistory.networks— still has a 2-networkdefault:matching its "In BETA and only accepts ETH & BASE mainnets" description; unaffected by PR [docs-agent] Remove false networks default on Portfolio by-address requests #1649 and out of scope here.Semantics net: no
default:anywhere on the touched fields (matches API reality —networksis required), and all five endpoints now have BOTH a schema-levelexample:(for schema tables) AND an inline requestBodyexample:(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)