fumadocs-openapi 10.8.1 → 10.8.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.
Files changed (120) hide show
  1. package/css/generated/shared.css +4 -1
  2. package/dist/node_modules/.pnpm/{@scalar_helpers@0.5.2 → @scalar_helpers@0.6.0}/node_modules/@scalar/helpers/dist/general/create-limiter.js +1 -1
  3. package/dist/node_modules/.pnpm/{@scalar_helpers@0.5.2 → @scalar_helpers@0.6.0}/node_modules/@scalar/helpers/dist/object/is-object.js +1 -1
  4. package/dist/node_modules/.pnpm/{@scalar_helpers@0.5.2 → @scalar_helpers@0.6.0}/node_modules/@scalar/helpers/dist/object/prevent-pollution.js +1 -1
  5. package/dist/node_modules/.pnpm/{@scalar_helpers@0.5.2 → @scalar_helpers@0.6.0}/node_modules/@scalar/helpers/dist/queue/queue.js +1 -1
  6. package/dist/node_modules/.pnpm/{@scalar_helpers@0.5.2 → @scalar_helpers@0.6.0}/node_modules/@scalar/helpers/dist/string/generate-hash.js +1 -1
  7. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/bundle/bundle.js +2 -2
  8. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/bundle/plugins/fetch-urls/index.js +2 -2
  9. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.12/node_modules/@scalar/json-magic/dist/bundle/plugins/parse-yaml/index.js +1 -0
  10. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/bundle/plugins/read-files/index.js +1 -1
  11. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/bundle/value-generator.js +2 -2
  12. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/convert-to-local-ref.js +1 -1
  13. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/escape-json-pointer.js +1 -1
  14. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/get-schemas.js +1 -1
  15. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/get-segments-from-path.js +1 -1
  16. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/get-value-by-path.js +1 -1
  17. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/is-file-path.js +1 -1
  18. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/is-http-url.js +1 -1
  19. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/is-json-object.js +2 -2
  20. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/is-yaml.js +1 -1
  21. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/normalize.js +3 -3
  22. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/resolve-reference-path.js +1 -1
  23. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/set-value-at-path.js +2 -2
  24. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/to-relative-path.js +1 -1
  25. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/helpers/unescape-json-pointer.js +1 -1
  26. package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.6 → @scalar_openapi-upgrader@0.2.7}/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js +1 -1
  27. package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.6 → @scalar_openapi-upgrader@0.2.7}/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js +1 -1
  28. package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.6 → @scalar_openapi-upgrader@0.2.7}/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js +1 -1
  29. package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.6 → @scalar_openapi-upgrader@0.2.7}/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js +1 -1
  30. package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.6 → @scalar_openapi-upgrader@0.2.7}/node_modules/@scalar/openapi-upgrader/dist/upgrade.js +1 -1
  31. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/compose-collection.js +1 -1
  32. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/compose-doc.js +1 -1
  33. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/compose-node.js +1 -1
  34. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/compose-scalar.js +1 -1
  35. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/composer.js +1 -1
  36. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/resolve-block-map.js +1 -1
  37. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +1 -1
  38. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +1 -1
  39. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/resolve-end.js +1 -1
  40. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +1 -1
  41. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +5 -8
  42. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/resolve-props.js +1 -1
  43. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/util-contains-newline.js +1 -1
  44. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +1 -1
  45. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +1 -1
  46. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/compose/util-map-includes.js +1 -1
  47. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/doc/Document.js +1 -1
  48. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/doc/anchors.js +1 -1
  49. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/doc/applyReviver.js +1 -1
  50. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/doc/createNode.js +1 -1
  51. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/doc/directives.js +1 -1
  52. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/errors.js +1 -1
  53. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/log.js +1 -1
  54. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/nodes/Alias.js +2 -1
  55. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/nodes/Collection.js +1 -1
  56. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/nodes/Node.js +1 -1
  57. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/nodes/Pair.js +1 -1
  58. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/nodes/Scalar.js +1 -1
  59. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/nodes/YAMLMap.js +1 -1
  60. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +1 -1
  61. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +1 -1
  62. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/nodes/identity.js +1 -1
  63. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/nodes/toJS.js +1 -1
  64. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/parse/cst-visit.js +1 -1
  65. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/parse/lexer.js +1 -1
  66. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/parse/line-counter.js +1 -1
  67. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/parse/parser.js +1 -1
  68. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/public-api.js +1 -1
  69. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/Schema.js +1 -1
  70. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/common/map.js +1 -1
  71. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/common/null.js +1 -1
  72. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/common/seq.js +1 -1
  73. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/common/string.js +1 -1
  74. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/core/bool.js +1 -1
  75. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/core/float.js +1 -1
  76. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/core/int.js +1 -1
  77. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/core/schema.js +1 -1
  78. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/json/schema.js +1 -1
  79. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/tags.js +1 -1
  80. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +1 -1
  81. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +1 -1
  82. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +1 -1
  83. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +1 -1
  84. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +9 -6
  85. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +1 -1
  86. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +1 -1
  87. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +1 -1
  88. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +1 -1
  89. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +1 -1
  90. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +1 -1
  91. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/stringify/stringify.js +1 -1
  92. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +1 -1
  93. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/stringify/stringifyComment.js +1 -1
  94. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +1 -1
  95. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +2 -2
  96. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/stringify/stringifyPair.js +1 -1
  97. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/stringify/stringifyString.js +1 -1
  98. package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/visit.js +1 -1
  99. package/dist/playground/client.d.ts +2 -0
  100. package/dist/playground/client.js +2 -2
  101. package/dist/server/source-api.d.ts +1 -0
  102. package/dist/server/source-api.js +6 -1
  103. package/dist/ui/base.js +2 -1
  104. package/dist/ui/create-client.js +2 -1
  105. package/dist/ui/operation/index.js +15 -3
  106. package/dist/ui/operation/usage-tabs/client.js +4 -1
  107. package/dist/utils/document/process.js +5 -5
  108. package/dist/utils/pages/builder.d.ts +1 -0
  109. package/dist/utils/pages/preset-auto.js +9 -6
  110. package/dist/utils/pages/to-text.d.ts +1 -1
  111. package/dist/utils/pages/to-text.js +17 -22
  112. package/dist/utils/schema/index.d.ts +4 -0
  113. package/dist/utils/schema/to-string.js +11 -8
  114. package/package.json +16 -19
  115. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.8/node_modules/@scalar/json-magic/dist/bundle/plugins/parse-yaml/index.js +0 -1
  116. /package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.8 → @scalar_json-magic@0.12.12}/node_modules/@scalar/json-magic/dist/bundle/plugins/node.js +0 -0
  117. /package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/index.js +0 -0
  118. /package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/parse/cst-scalar.js +0 -0
  119. /package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/dist/parse/cst.js +0 -0
  120. /package/dist/node_modules/.pnpm/{yaml@2.8.3 → yaml@2.8.4}/node_modules/yaml/browser/index.js +0 -0
@@ -58,17 +58,18 @@ function createAutoPreset(options) {
58
58
  tags = ["unknown"];
59
59
  }
60
60
  for (const tag of tags) {
61
+ const res = builder.fromTagName(tag);
62
+ if (!res) continue;
61
63
  const groupName = slugify(tag);
62
- const { displayName, info } = builder.fromTagName(tag);
63
64
  let group = groups.get(groupName);
64
65
  if (!group) {
65
66
  group = {
66
67
  type: "group",
67
68
  info: {
68
- title: displayName,
69
- description: info.description
69
+ title: res.displayName,
70
+ description: res.info.description
70
71
  },
71
- tag: info,
72
+ tag: res.info,
72
73
  entries: [],
73
74
  schemaId: builder.id,
74
75
  path: groupName
@@ -161,7 +162,8 @@ function createAutoPreset(options) {
161
162
  item: op,
162
163
  info: {
163
164
  title: displayName,
164
- description: operation.description ?? pathItem.description
165
+ description: operation.description ?? pathItem.description,
166
+ deprecated: operation.deprecated
165
167
  }
166
168
  });
167
169
  }
@@ -172,7 +174,8 @@ function createAutoPreset(options) {
172
174
  schemaId: builder.id,
173
175
  info: {
174
176
  title: displayName,
175
- description: operation.description ?? pathItem.description
177
+ description: operation.description ?? pathItem.description,
178
+ deprecated: operation.deprecated
176
179
  },
177
180
  item: webhook
178
181
  });
@@ -34,7 +34,7 @@ interface PagesToTextOptions {
34
34
  }
35
35
  type DocumentContext = {
36
36
  type: 'tag';
37
- tag: TagObject | undefined;
37
+ tag: TagObject;
38
38
  } | {
39
39
  type: 'operation';
40
40
  } | {
@@ -5,25 +5,13 @@ import { dump } from "js-yaml";
5
5
  //#region src/utils/pages/to-text.ts
6
6
  function toText(entry, processed, options = {}) {
7
7
  switch (entry.type) {
8
- case "operation": return generatePage(entry.schemaId, processed, { operations: [entry.item] }, {
9
- ...options,
10
- ...entry.info
11
- }, { type: "operation" });
8
+ case "operation": return generatePage(entry.schemaId, processed, { operations: [entry.item] }, options, entry);
12
9
  case "page": return generatePage(entry.schemaId, processed, {
13
10
  operations: entry.operations,
14
11
  webhooks: entry.webhooks,
15
12
  showTitle: true
16
- }, {
17
- ...options,
18
- ...entry.info
19
- }, entry.tag ? {
20
- type: "tag",
21
- tag: entry.tag
22
- } : { type: "file" });
23
- case "webhook": return generatePage(entry.schemaId, processed, { webhooks: [entry.item] }, {
24
- ...options,
25
- ...entry.info
26
- }, { type: "operation" });
13
+ }, options, entry);
14
+ case "webhook": return generatePage(entry.schemaId, processed, { webhooks: [entry.item] }, options, entry);
27
15
  }
28
16
  }
29
17
  function generateDocument(frontmatter, content, options) {
@@ -41,26 +29,33 @@ function generateDocument(frontmatter, content, options) {
41
29
  out.push(content);
42
30
  return out.join("\n\n");
43
31
  }
44
- function generatePage(schemaId, processed, pageProps, options, context) {
32
+ function generatePage(schemaId, processed, pageProps, options, entry) {
45
33
  const { frontmatter, includeDescription = false } = options;
46
- const extend = frontmatter?.(options.title, options.description, context);
34
+ const extend = frontmatter?.(entry.info.title, entry.info.description, entry.type === "page" ? entry.tag ? {
35
+ type: "tag",
36
+ tag: entry.tag
37
+ } : { type: "file" } : { type: "operation" });
47
38
  const page = {
48
39
  ...pageProps,
49
40
  document: schemaId
50
41
  };
51
42
  let meta;
52
- if (page.operations?.length === 1) meta = { method: page.operations[0].method.toUpperCase() };
43
+ if (page.operations?.length === 1) meta = {
44
+ method: page.operations[0].method.toUpperCase(),
45
+ deprecated: entry.info.deprecated
46
+ };
53
47
  else if (page.webhooks?.length === 1) meta = {
54
48
  method: page.webhooks[0].method.toUpperCase(),
55
- webhook: true
49
+ webhook: true,
50
+ deprecated: entry.info.deprecated
56
51
  };
57
52
  const data = toStaticData(page, processed.dereferenced);
58
53
  const content = [];
59
- if (options.description && includeDescription) content.push(options.description);
54
+ if (entry.info.description && includeDescription) content.push(entry.info.description);
60
55
  content.push(pageContent(page));
61
56
  return generateDocument({
62
- title: options.title,
63
- description: !includeDescription ? options.description : void 0,
57
+ title: entry.info.title,
58
+ description: !includeDescription ? entry.info.description : void 0,
64
59
  full: true,
65
60
  ...extend,
66
61
  _openapi: {
@@ -5,6 +5,10 @@ import { JSONSchema } from "json-schema-typed/draft-2020-12";
5
5
  type NoReference<T> = T extends (infer I)[] ? NoReference<I>[] : T extends ReferenceObject ? Exclude<T, ReferenceObject> : T extends object ? { [K in keyof T]: NoReference<T[K]> } : T;
6
6
  type ParsedSchema = (JSONSchema & {
7
7
  'x-playground-lazy'?: boolean;
8
+ discriminator?: {
9
+ propertyName?: string;
10
+ mapping?: Record<string, string>;
11
+ };
8
12
  }) | boolean;
9
13
  interface SecurityEntry {
10
14
  scopes: string[];
@@ -9,14 +9,18 @@ function schemaToString(value, _resolver, flags = 0) {
9
9
  };
10
10
  function union(union, sep, flags) {
11
11
  const members = /* @__PURE__ */ new Set();
12
+ const out = [];
12
13
  let nullable = false;
13
14
  for (const item of union) {
14
15
  const result = run(item, flags | 1);
15
16
  if (result === "null") nullable = true;
16
- else if (result !== "unknown") members.add(result);
17
+ else if (result !== "unknown" && !members.has(result)) {
18
+ out.push(result);
19
+ members.add(result);
20
+ }
17
21
  }
18
- const result = Array.from(members).join(sep);
19
- return nullable ? `${result} | null` : result;
22
+ if (nullable) out.push("null");
23
+ return out.join(sep);
20
24
  }
21
25
  function run(input, flags) {
22
26
  const { dereferenced: schema, raw } = resolver(input);
@@ -34,14 +38,13 @@ function schemaToString(value, _resolver, flags = 0) {
34
38
  type
35
39
  })), " | ", flags);
36
40
  if (schema.type === "array") return `array<${schema.items ? run(schema.items, flags | 1) : "unknown"}>`;
37
- const or = schema.oneOf ?? schema.anyOf;
38
41
  if (schema.oneOf && schema.anyOf) return `(${union(schema.oneOf, " | ", flags)}) & (${union(schema.anyOf, " | ", flags)})`;
39
- else if (or) return union(or, " | ", flags);
42
+ const or = schema.oneOf ?? schema.anyOf;
43
+ if (or) return union(or, " | ", flags);
40
44
  if (schema.allOf) return union(schema.allOf, " & ", flags);
41
- if (schema.not) return `not ${run(schema.not, flags)}`;
45
+ if (schema.not) return `not (${run(schema.not, flags)})`;
42
46
  if (schema.type === "string" && schema.format === "binary") return "file";
43
- if (schema.type && Array.isArray(schema.type)) return schema.type.filter((v) => v !== "null").join(" | ");
44
- if (schema.type) return schema.type;
47
+ if (typeof schema.type === "string") return schema.type;
45
48
  return "unknown";
46
49
  }
47
50
  return run(value, flags);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-openapi",
3
- "version": "10.8.1",
3
+ "version": "10.8.3",
4
4
  "description": "Generate MDX docs for your OpenAPI spec",
5
5
  "keywords": [
6
6
  "Docs",
@@ -15,9 +15,6 @@
15
15
  "dist"
16
16
  ],
17
17
  "type": "module",
18
- "main": "./dist/index.js",
19
- "module": "./dist/index.js",
20
- "types": "./dist/index.d.ts",
21
18
  "exports": {
22
19
  ".": "./dist/index.js",
23
20
  "./i18n": "./dist/i18n.js",
@@ -54,29 +51,29 @@
54
51
  "github-slugger": "^2.0.0",
55
52
  "hast-util-to-jsx-runtime": "^2.3.6",
56
53
  "js-yaml": "^4.1.1",
57
- "lucide-react": "^1.11.0",
54
+ "lucide-react": "^1.14.0",
58
55
  "remark": "^15.0.1",
59
56
  "remark-rehype": "^11.1.2",
60
57
  "shiki": "^4.0.2",
61
- "tailwind-merge": "^3.5.0",
58
+ "tailwind-merge": "^3.6.0",
62
59
  "xml-js": "^1.6.11",
63
60
  "@fumari/stf": "1.0.5"
64
61
  },
65
62
  "devDependencies": {
66
63
  "@fastify/deepmerge": "^3.2.1",
67
64
  "@scalar/api-client-react": "2.0.1",
68
- "@scalar/json-magic": "^0.12.8",
69
- "@scalar/openapi-upgrader": "^0.2.6",
70
- "@tailwindcss/oxide": "^4.2.4",
65
+ "@scalar/json-magic": "^0.12.12",
66
+ "@scalar/openapi-upgrader": "^0.2.7",
67
+ "@tailwindcss/oxide": "^4.3.0",
71
68
  "@types/js-yaml": "^4.0.9",
72
- "@types/node": "25.6.0",
69
+ "@types/node": "25.6.2",
73
70
  "@types/react": "^19.2.14",
74
71
  "fast-content-type-parse": "^3.0.0",
75
72
  "json-schema-typed": "^8.0.2",
76
- "tailwindcss": "^4.2.4",
77
- "tsdown": "0.21.10",
78
- "fumadocs-core": "16.8.5",
79
- "fumadocs-ui": "16.8.5",
73
+ "tailwindcss": "^4.3.0",
74
+ "tsdown": "0.22.0",
75
+ "fumadocs-core": "16.8.11",
76
+ "fumadocs-ui": "16.8.11",
80
77
  "tsconfig": "0.0.0"
81
78
  },
82
79
  "peerDependencies": {
@@ -101,15 +98,15 @@
101
98
  },
102
99
  "inlinedDependencies": {
103
100
  "@fastify/deepmerge": "3.2.1",
104
- "@scalar/helpers": "0.5.2",
105
- "@scalar/json-magic": "0.12.8",
106
- "@scalar/openapi-upgrader": "0.2.6",
101
+ "@scalar/helpers": "0.6.0",
102
+ "@scalar/json-magic": "0.12.12",
103
+ "@scalar/openapi-upgrader": "0.2.7",
107
104
  "fast-content-type-parse": "3.0.0",
108
105
  "pathe": "2.0.3",
109
- "yaml": "2.8.3"
106
+ "yaml": "2.8.4"
110
107
  },
111
108
  "scripts": {
112
- "build": "tsdown --config-loader unrun",
109
+ "build": "tsdown",
113
110
  "clean": "rimraf dist",
114
111
  "dev": "tsdown --watch --clean false",
115
112
  "lint": "oxlint .",
@@ -1 +0,0 @@
1
- import "../../../../../../../../yaml@2.8.3/node_modules/yaml/browser/index.js";