mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 05:23:40 +00:00
OpenAPI: fix parameter encoding
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-openapi': patch
|
||||
---
|
||||
|
||||
fix parameter encoding
|
||||
@@ -44,7 +44,8 @@ export function encodeRequestData(
|
||||
|
||||
const encoder = getMediaEncoder(field, adapters);
|
||||
if (encoder) {
|
||||
result[type][key] = { value: encoder(value) };
|
||||
if (type === 'query') result[type][key] = { values: [encoder(value)] };
|
||||
else result[type][key] = { value: encoder(value) };
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ export function resolveRequestData(pathname: string, { path, query }: RequestDat
|
||||
// Add new query parameters from the RequestData
|
||||
for (const key in query) {
|
||||
const param = query[key];
|
||||
if (param.values.length === 0) continue;
|
||||
if (!param || param.values.length === 0) continue;
|
||||
|
||||
// Remove existing parameter first to avoid duplicates
|
||||
searchParams.delete(key);
|
||||
|
||||
@@ -16,9 +16,7 @@ export default defineConfig({
|
||||
],
|
||||
fixedExtension: false,
|
||||
unbundle: true,
|
||||
dts: {
|
||||
sourcemap: false,
|
||||
},
|
||||
dts: true,
|
||||
async onSuccess() {
|
||||
await compileInline();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user