mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
## Problem Agents can't find request body fields for Management API endpoints. In an eval for the access control guide ([DOCS-1489](https://linear.app/supabase/issue/DOCS-1489)), an agent read the [Create organization invitations](https://supabase.com/docs/reference/api/v2-create-organization-invitations) page and concluded the body accepts only an email. It refused to invite someone scoped to one project, even though the API accepts `role` and `projects`. Reference pages have no `.md` version. Their markdown 404 points agents to the markdown reference (`llms/api.txt`), which lists path and query parameters but no request body for any endpoint. Resolves part of [DOCS-1823](https://linear.app/supabase/issue/DOCS-1823). ## Solution Each endpoint with a request body gets a **Request body** section in the markdown reference. It lists every field as a nested list with its type, whether it's required, its description, accepted values, defaults, and constraints. Unions list each option by name, and map-like objects show the shape of their values. This changes only the generated markdown. Reference pages render the same as before. Reference pages don't have their own `.md` versions yet. That's tracked in [DOCS-1332](https://linear.app/supabase/issue/DOCS-1332). The new renderer takes one endpoint's request body and returns markdown, so a per-page generator can reuse it. ## Follow-ups - **Reference page HTML (rest of DOCS-1823):** nested schema fields still reach the HTML only after someone opens their control. Moving these controls to native `<details>` also needs three fixes found in review: - A union option puts an `<li>` inside another `<li>`, which breaks the list once the content is in the HTML. - The **Items** control for an array of union items, such as the notebook `cells` array, opens an empty panel. - The new summary styles repeat the current trigger's styles. They should share one base. - **Parameters:** path and query parameters still use the older one-line format, so their accepted values don't appear in the markdown reference. For example, `continent` on the available regions endpoint lists no values. - **Shared schema helpers:** the renderer copies `asSchemaArray` from `Reference.ui.tsx` and adds its own schema type. Sharing both through `Reference.api.utils.ts` keeps the HTML and the markdown in step. ## Review category (docs PRs only) - [ ] Critical: needs a review as soon as possible - [ ] Urgent: the feature ships soon, or it's blocking something else - [x] Moderate: good to have soon, not urgent - [ ] Low: get to it when you can ## Review instructions 1. Open the [Management API markdown reference on the preview](https://docs-git-alexisa-docs-1823-supabase.vercel.app/docs/markdown/reference/api.md). On production, the same file is served at `/llms/api.txt`. 2. Under **Creates organization invitations**, see the **Request body** section with `data`, `type`, `attributes`, `email`, `role`, `projects`, and `require_sso`. 3. Under **Assign or change an organization member role**, see `data.attributes.role` and `projects`. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)