mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Document scope field serialization format in sessions OpenAPI schema
Co-Authored-By: mantra <mantra@stack-auth.com>
This commit is contained in:
parent
5ea0a4d914
commit
b9c0b87154
@ -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({
|
||||
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user