Skip to content

[PLAT-9549] - dev-portal: document JSON:API sparse fieldset rules - #118

Open
sksizer wants to merge 3 commits into
mainfrom
PLAT-9549-dev-portal-document-json-api-sparse-fieldset-rules
Open

sksizer wants to merge 3 commits into
mainfrom
PLAT-9549-dev-portal-document-json-api-sparse-fieldset-rules

Conversation

@sksizer

@sksizer sksizer commented Oct 2, 2026 •

Copy link
Copy Markdown
Author Host When
Agent:(claude-opus-5.5) Cursor on SKs-MacBook-Pro.local 2026-10-02 14:45 CDT

Summary

Adds a public API Conventions guide, docs/guides/api-conventions.mdx. It states that the Vertex Platform API follows JSON:API and gives the sparse fieldset rules in one place, so the API Reference, support, and Jira can link to them. It is part of PLAT-9548.

The Sparse fieldsets section, at the stable anchor #sparse-fieldsets, states:

  • fields[<type>] takes a comma-separated list of field names.
  • Spaces around commas are ignored.
  • An empty value returns no fields.
  • Field names are case-sensitive and must match exactly.
  • Names that don't match a field, including names that differ only in case, are ignored.
  • Some fields (for example metadata) are returned only when requested.
  • It links to the JSON:API sparse fieldsets section.
  • A note covers the exception: fields[thread] only opts into replyCount and doesn't restrict other thread fields. This matches ThreadRouter.replyCountFieldMask in vertex-api. Remove the note when PLAT-9551 ships. That is the coordinated fields[thread] rollout, and its vertex-api change is PLAT-9550.

The page is registered in sidebars.js (guidesSidebar, Reference category). guides.js isn't used by the site, so it isn't changed.

Expected URL once deployed: https://developer.vertex3d.com/docs/guides/api-conventions#sparse-fieldsets

Test Plan

  • yarn install --frozen-lockfile and yarn build: passed. Docusaurus generated build/docs/guides/api-conventions/index.html.
  • The built page contains the heading anchor id="sparse-fieldsets", and other guide pages' sidebars link to /docs/guides/api-conventions.
  • The current docs version is served at path '' (docusaurus.config.js), so the page publishes at /docs/guides/api-conventions, not under a version prefix.
  • prettier --check on the changed files and yarn lint: passed.
  • The request-only fields and the fields[thread] behavior were checked against src/universal/api.yml and ThreadRouter.scala on the vertex-api#810 branch.
  • I didn't run a local dev server or take screenshots.

Release Notes

New developer guide: API Conventions explains how sparse fieldsets (fields[<type>]) select the fields returned by Platform API responses.

Possible Regressions

  • Docs only, with one new sidebar entry. Until vertex-api#810 is deployed, the whitespace rule is wrong: padded lists such as fields[scene]=name, created don't match. The comma-only empty value fields[scene]=, is also wrong until then, because it still returns every field. See Dependencies.

Dependencies

  • Merge only after vertex-api#810 (PLAT-9470) is deployed. This page states that spaces around commas are ignored, and only that change makes it true.
  • vertex-api#810 links its fields[...] parameter descriptions to this page's #sparse-fieldsets anchor, so the anchor must stay stable.
  • test-automation#75 (PLAT-9471) covers the same behavior in API tests. There is no merge ordering against this PR.

Related


Note

Low Risk
Documentation and sidebar navigation only; no runtime or API code changes.

Overview
Adds a new API Conventions developer guide that documents JSON:API usage on the Platform API and centralizes sparse fieldset behavior for fields[<type>] (comma lists, whitespace, empty values, case sensitivity, opt-in fields like metadata, and default fields when omitted). Includes a curl example and a note that fields[thread] only opts into replyCount without restricting other thread fields.

Registers the page at the top of the Reference section in sidebars.js so it publishes at /docs/guides/api-conventions with anchor #sparse-fieldsets for cross-links from the API Reference.

Reviewed by Cursor Bugbot for commit 6f6848d. Bugbot is set up for automated code reviews on this repo. Configure here.

sksizer and others added 2 commits October 2, 2026 14:08
Add an API Conventions guide with a Sparse fieldsets section and register it in the guides sidebar.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sksizer
sksizer marked this pull request as ready for review October 2, 2026 19:31
@sksizer
sksizer requested a review from a team as a code owner October 2, 2026 19:31
@sksizer
sksizer requested a balanced review from Copilot October 2, 2026 19:31

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0c4c91f. Configure here.

Comment thread docs/guides/api-conventions.mdx

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Publication depends on confirming deployment of the inaccessible vertex-api#810 behavior change.

Review effort: Balanced
Findings: None

What changed in this PR

Adds a public API conventions guide documenting JSON:API sparse fieldsets and registers it in the Reference sidebar.

Changes:

  • Documents sparse-fieldset parsing, defaults, and request-only fields.
  • Explains the temporary fields[thread] exception.
  • Adds the guide to navigation.
File Description
docs/​guides/​api-conventions.mdx Adds the API conventions guide.
sidebars.js Registers the guide under Reference.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The introduction inaccurately states that every resource includes attributes, contradicting the documented empty-fieldset response.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

Comment thread docs/guides/api-conventions.mdx Outdated
@sksizer

sksizer commented Oct 2, 2026 •

Copy link
Copy Markdown
Author
Author Host When
Agent:(claude-opus-5.5) Cursor on SKs-MacBook-Pro.local 2026-10-02 17:34 CDT

Response to the review round on 0c4c91f:

  • SonarCloud quality gate: passed with 0 new issues. No change needed.
  • Bugbot, hard-coded platform.vertexvis.com hostname: fixed in 6f6848d. The example now uses platform.[DNS_SUFFIX], the convention from [VPI-331] - Use DNS suffix in token exchange guide examples #117. Thread resolved.
  • Copilot overview, "publication depends on confirming deployment of vertex-api#810": agreed, and no code change is needed. The Dependencies section already says this PR merges only after vertex-api#810 (PLAT-9470) is deployed. The person merging this PR needs to confirm that deployment first.
  • Copilot finding, resource objects don't always include attributes: fixed in 6f6848d. Thread resolved.

Validation on 6f6848d: yarn build passed, the built page still has id="sparse-fieldsets", and prettier --check passed.

@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

@sksizer

sksizer commented Oct 2, 2026

Copy link
Copy Markdown
Author
Author Host When
Agent:(claude-opus-5.5) Cursor on SKs-MacBook-Pro.local 2026-10-02 17:37 CDT

SonarCloud quality gate on 6f6848d: passed with 0 new issues and 0 security hotspots. No change needed.

This branch has not been deployed

No deployments
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