fumadocs-openapi 3.1.1 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -55,7 +55,9 @@ interface GenerateOptions {
55
55
  from: string;
56
56
  }[];
57
57
  /**
58
- * Customise frontmatter
58
+ * Customise frontmatter.
59
+ *
60
+ * A `full: true` property will be added by default.
59
61
  */
60
62
  frontmatter?: (title: string, description: string | undefined) => Record<string, unknown>;
61
63
  renderer?: Partial<Renderer>;
package/dist/index.js CHANGED
@@ -102,6 +102,7 @@ function renderPage(title, description, content, options) {
102
102
  const banner = dump({
103
103
  title,
104
104
  description,
105
+ full: true,
105
106
  ...options.frontmatter?.(title, description)
106
107
  }).trim();
107
108
  const finalImports = (options.imports ?? [
@@ -181,8 +182,10 @@ function createEndpoint(path, method, baseUrl) {
181
182
  toSampleInput(value)
182
183
  );
183
184
  }
185
+ if (queryParams.size > 0)
186
+ pathWithParameters = `${pathWithParameters}?${queryParams.toString()}`;
184
187
  return {
185
- url: new URL(pathWithParameters, baseUrl).toString(),
188
+ url: new URL(`${baseUrl}${pathWithParameters}`).toString(),
186
189
  body: bodySchema ? generateInput(method.method, bodySchema) : void 0,
187
190
  responses,
188
191
  method: method.method,
@@ -385,7 +388,10 @@ async function renderOperation(path, method, ctx, noTitle = false) {
385
388
  const info = [];
386
389
  const example = [];
387
390
  const title = method.summary ?? method.operationId;
388
- if (title && !noTitle) info.push(heading(level++, title));
391
+ if (title && !noTitle) {
392
+ info.push(heading(level, title));
393
+ level++;
394
+ }
389
395
  if (method.description) info.push(p(method.description));
390
396
  if (security) {
391
397
  info.push(heading(level, "Authorization"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-openapi",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "Generate MDX docs for your OpenAPI spec",
5
5
  "keywords": [
6
6
  "NextJs",