Skip to content

Commit fbf03c6

Browse files
committed
refactor: remove redundant agent metadata from OpenAPI document generation
1 parent 0202d85 commit fbf03c6

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

adminforth/documentation/docs/tutorial/08-Plugins/01-agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ To define a custom tool, register an API endpoint with `admin.express.endpoint`.
655655

656656
By default, `admin.express.endpoint` applies AdminForth authorization. The endpoint handler receives `adminUser` from the user who is controlling the agent. In other words, all permissions and access rights of the agent are defined by that admin user. At the same time, actions done by the agent are automatically attributed in the audit log to the admin user who is controlling the agent.
657657

658-
If a tool is risky, you can attach AdminForth agent metadata directly to the endpoint with the `agent` field. AdminForth renders it into OpenAPI as the vendor extension `x-adminforth-agent`.
658+
If a tool is risky, you can attach AdminForth agent metadata directly to the endpoint with the `agent` field.
659659

660660
```ts
661661
type AgentRiskLevel = 'safe' | 'danger';

adminforth/servers/openapiDocument.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,6 @@ export function buildOpenApiDocument(options: BuildOpenApiDocumentOptions): {[ke
363363
...(route.description ? {
364364
description: route.description,
365365
} : {}),
366-
...(route.agent ? {
367-
'x-adminforth-agent': route.agent,
368-
} : {}),
369366
...(route.request_schema ? {
370367
requestBody: {
371368
required: true,

0 commit comments

Comments
 (0)