mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
OpenAPI: fix hydration errors
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-openapi': patch
|
||||
---
|
||||
|
||||
fix hydration errors
|
||||
@@ -80,10 +80,9 @@ export function UsageTab({
|
||||
const code = useMemo(() => {
|
||||
if (!data) return;
|
||||
const url = joinURL(
|
||||
withBase(
|
||||
server ? resolveServerUrl(server.url, server.variables) : '/',
|
||||
typeof window !== 'undefined' ? window.location.origin : 'https://loading',
|
||||
),
|
||||
server && typeof window !== 'undefined'
|
||||
? withBase(resolveServerUrl(server.url, server.variables), window.location.origin)
|
||||
: 'https://example.com',
|
||||
resolveRequestData(route, data),
|
||||
);
|
||||
|
||||
|
||||
@@ -197,14 +197,16 @@ export function createAutoPreset(options: SchemaToPagesOptions): PagesBuilderCon
|
||||
}
|
||||
|
||||
for (const tag of tags) {
|
||||
const res = builder.fromTagName(tag);
|
||||
if (!res) continue;
|
||||
|
||||
const groupName = slugify(tag);
|
||||
const { displayName, info } = builder.fromTagName(tag)!;
|
||||
let group = groups.get(groupName);
|
||||
if (!group) {
|
||||
group = {
|
||||
type: 'group',
|
||||
info: { title: displayName, description: info.description },
|
||||
tag: info,
|
||||
info: { title: res.displayName, description: res.info.description },
|
||||
tag: res.info,
|
||||
entries: [],
|
||||
schemaId: builder.id,
|
||||
path: groupName,
|
||||
|
||||
Reference in New Issue
Block a user