Skip to content

Commit 91f4d0c

Browse files
committed
use summary as title
1 parent 3ac2f83 commit 91f4d0c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/components/APIRequest.astro

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,12 @@ const tokenGroups = operation["x-api-token-group"];
113113
)
114114
}
115115

116-
<CURL url={url.toString()} method={method} headers={headers} json={json} />
116+
<CURL
117+
url={url.toString()}
118+
method={method}
119+
headers={headers}
120+
json={json}
121+
code={{
122+
title: operation.summary,
123+
}}
124+
/>

src/components/CURL.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const props = z.object({
1212
url: z.string().url(),
1313
headers: z.record(z.string(), z.string()).default({}),
1414
json: z.record(z.string(), z.any()).optional(),
15-
code: z.custom<ComponentProps<typeof Code>>().optional(),
15+
code: z
16+
.custom<Omit<ComponentProps<typeof Code>, "code" | "lang">>()
17+
.optional(),
1618
});
1719
1820
const { method, url, headers, json, code } = props.parse(Astro.props);

0 commit comments

Comments
 (0)