Document scope field serialization format in sessions OpenAPI schema

Co-Authored-By: mantra <mantra@stack-auth.com>
This commit is contained in:
Devin AI 2026-06-01 21:12:12 +00:00
parent 5ea0a4d914
commit b9c0b87154
3 changed files with 11 additions and 5 deletions

View File

@ -25,7 +25,7 @@ export const POST = createSmartRouteHandler({
// Space-separated list of scopes to restrict the created session to (OAuth `scope`
// convention). Omitted = unrestricted session. Access tokens minted from this session
// carry these scopes and are gated by each endpoint's `requiredScopes`. See `scopes.ts`.
scope: yupString().optional(),
scope: yupString().optional().meta({ openapiField: { description: "Space-separated list of registered scopes to restrict the created session to (OAuth `scope` convention), e.g. `teams:read contact_channels:read`. Omitted means the session is unrestricted.", exampleValue: "teams:read contact_channels:read" } }),
}).defined(),
}),
response: yupObject({

View File

@ -8265,14 +8265,17 @@
"type": "boolean"
},
"scope": {
"type": "string"
"type": "string",
"example": "teams:read contact_channels:read",
"description": "Space-separated list of registered scopes to restrict the created session to (OAuth `scope` convention), e.g. `teams:read contact_channels:read`. Omitted means the session is unrestricted."
}
},
"required": [
"user_id"
],
"example": {
"user_id": "3241a285-8329-4d69-8f3d-316e08cf140c"
"user_id": "3241a285-8329-4d69-8f3d-316e08cf140c",
"scope": "teams:read contact_channels:read"
}
}
}

View File

@ -7516,14 +7516,17 @@
"type": "boolean"
},
"scope": {
"type": "string"
"type": "string",
"example": "teams:read contact_channels:read",
"description": "Space-separated list of registered scopes to restrict the created session to (OAuth `scope` convention), e.g. `teams:read contact_channels:read`. Omitted means the session is unrestricted."
}
},
"required": [
"user_id"
],
"example": {
"user_id": "3241a285-8329-4d69-8f3d-316e08cf140c"
"user_id": "3241a285-8329-4d69-8f3d-316e08cf140c",
"scope": "teams:read contact_channels:read"
}
}
}