Skip to content

openapi.yaml seems to drift from the admin handlers in several places #2859

Open

Description

@QuintinWillison

As part of my planning process for capability additions to our new, official Go SDK, I am getting Claude to scope by looking across existing SDK implementations as well as upstream specs and implementations where that makes sense. For my latest round of planning, it has identified some potential fixups in this repository which might be better triaged and ultimately handled by those who understand this repository at a deeper level...

🤖 Claude's Summary

Found while writing SDK capability specs against openapi.yaml at 0907af9:

  1. PUT /admin/users/{userId}/factors/{factorId} documents an empty request body. The handler reads friendly_name and phone (internal/api/admin.go, adminUserUpdateFactorParams).
  2. GET /admin/audit documents page and per_page only. The handler also reads a query filter of the form <author|action|type>:<text> (internal/api/audit.go, adminAuditLog).
  3. POST /admin/sso/providers documents a 200 response. The handler returns 201 (internal/api/ssoadmin.go, adminSSOProvidersCreate).
  4. POST and PUT /admin/sso/providers document neither name_id_format, resource_id nor disabled, and {ssoProviderId} is documented as a UUID although resource_<resource_id> is accepted (loadSSOProvider).
  5. GET /admin/sso/providers documents no query parameters. The handler reads resource_id and resource_id_prefix filters.
  6. SSOProviderSchema names the domain list sso_domains. The wire field is domains (internal/models/sso.go, SSOProvider).
  7. The SSO create and update operations do not document their 422 responses (saml_idp_already_exists on create, conflict on update).
  8. POST /admin/generate_link lists five type values. The handler also accepts invite.
  9. DELETE /admin/users/{userId} documents no request body. The handler reads should_soft_delete.
  10. GET /admin/users and GET /admin/audit document no response headers. Both set X-Total-Count and Link for pagination (internal/api/pagination.go, addPaginationHeaders).

Related:

Activity

  1. QuintinWillison commented on Oct 8, 2026

    @QuintinWillison
    MemberAuthor

    An eleventh item, found while writing the SDK capability spec for admin.delete_user (supabase/sdk#259, where the spec's API section points at the handler for this):

    1. DELETE /admin/users/{userId} documents the deleted user (UserSchema, "User's account data") as the 200 response body. The handler answers with an empty JSON object, and has since 2017 (internal/api/admin.go, adminUserDelete, sendJSON(w, http.StatusOK, map[string]interface{}{})). supabase-js types the call's result from the documented shape and so returns an empty object typed as a user.
  2. haranishi commented on Oct 11, 2026

    @haranishi

    I checked the eleven reported discrepancies against the current admin handlers and models. I am preparing a documentation-only patch to openapi.yaml covering the request fields, filters, SSO response codes and field names, pagination headers, and the empty admin-delete response. I will validate the OpenAPI structure and references and compare the documented shapes with the server source before opening a PR.

  3. haranishi commented on Oct 11, 2026

    @haranishi

    Implemented all eleven reported specification discrepancies in Draft PR #2866. The changes were compared with the current handlers, pagination helpers, SSO models, and pinned SAML NameID-format constants.

    Formatting and whitespace checks pass. OpenAPI structure/reference validation adds no issues and finds no unresolved references; the three pre-existing structural errors are documented in the PR. Generating the admin Go client with the pinned oapi-codegen v2.8.0 produces reproducible output that compiles and passes the Go vet checks. The submitted diff stays in openapi.yaml, because committing the generated output would change existing Go method signatures and needs a separate compatibility review.

    The related JavaScript SDK deletion-response correction is submitted to v3 in supabase/supabase-js#2758, with local hard/soft-deletion coverage.

    #2866

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions