@scalar/openapi-to-markdown 0.5.3 → 0.5.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @scalar/openapi-to-markdown
2
2
 
3
+ ## 0.5.5
4
+
5
+ ## 0.5.4
6
+
7
+ ### Patch Changes
8
+
9
+ - [#8825](https://github.com/scalar/scalar/pull/8825): chore: moving files around in preparation for the big deletion of client v1
10
+
3
11
  ## 0.5.3
4
12
 
5
13
  ## 0.5.2
@@ -1,11 +1,8 @@
1
- import type { MaybeRefSchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema';
2
1
  type __VLS_Props = {
3
2
  xml?: boolean;
4
- modelValue: MaybeRefSchemaObject;
3
+ modelValue: unknown;
5
4
  };
6
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
- xml: boolean;
8
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
6
  declare const _default: typeof __VLS_export;
10
7
  export default _default;
11
8
  //# sourceMappingURL=XmlOrJson.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"XmlOrJson.vue.d.ts","sourceRoot":"","sources":["../../src/components/XmlOrJson.vue"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAA;AAE9F,KAAK,WAAW,GAAG;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,UAAU,EAAE,oBAAoB,CAAA;CACjC,CAAC;AAkDJ,QAAA,MAAM,YAAY;SApDR,OAAO;6EAuDf,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"XmlOrJson.vue.d.ts","sourceRoot":"","sources":["../../src/components/XmlOrJson.vue"],"names":[],"mappings":"AA2BA,KAAK,WAAW,GAAG;IACjB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;AA+CF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
package/dist/index.js CHANGED
@@ -12,8 +12,8 @@ import { unified } from "unified";
12
12
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSSRApp, createTextVNode, createVNode, defineComponent, openBlock, renderList, resolveComponent, toDisplayString, unref } from "vue";
13
13
  import { renderToString } from "vue/server-renderer";
14
14
  import { ScalarMarkdown } from "@scalar/components";
15
- import { getExampleFromSchema } from "@scalar/oas-utils/spec-getters";
16
15
  import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
16
+ import { getExampleFromSchema } from "@scalar/workspace-store/request-example";
17
17
  import { resolve } from "@scalar/workspace-store/resolve";
18
18
  import { json2xml } from "@scalar/helpers/file/json2xml";
19
19
  //#region src/components/Schema.vue?vue&type=script&setup=true&lang.ts
@@ -195,8 +195,9 @@ var XmlOrJson_default = /* @__PURE__ */ defineComponent({
195
195
  modelValue: {}
196
196
  },
197
197
  setup(__props) {
198
+ const xmlContent = computed(() => json2xml(__props.modelValue));
198
199
  return (_ctx, _cache) => {
199
- return __props.xml ? (openBlock(), createElementBlock("pre", _hoisted_1$1, [createElementVNode("code", _hoisted_2$1, toDisplayString(unref(json2xml)(__props.modelValue)), 1)])) : (openBlock(), createElementBlock("pre", _hoisted_3$1, [createElementVNode("code", _hoisted_4$1, toDisplayString(JSON.stringify(__props.modelValue, null, 2)), 1)]));
200
+ return __props.xml ? (openBlock(), createElementBlock("pre", _hoisted_1$1, [createElementVNode("code", _hoisted_2$1, toDisplayString(xmlContent.value), 1)])) : (openBlock(), createElementBlock("pre", _hoisted_3$1, [createElementVNode("code", _hoisted_4$1, toDisplayString(JSON.stringify(__props.modelValue, null, 2)), 1)]));
200
201
  };
201
202
  }
202
203
  });
@@ -349,9 +350,9 @@ var MarkdownReference_default = /* @__PURE__ */ defineComponent({
349
350
  createVNode(Schema_default, { schema: resolveSchema(bodyContent.schema) }, null, 8, ["schema"]),
350
351
  _cache[17] || (_cache[17] = createElementVNode("p", null, [createElementVNode("strong", null, "Example:")], -1)),
351
352
  createVNode(XmlOrJson_default, {
352
- xml: mediaType?.toString().includes("xml"),
353
- "model-value": unref(getExampleFromSchema)(resolveSchema(bodyContent.schema), { xml: mediaType?.toString().includes("xml") })
354
- }, null, 8, ["xml", "model-value"])
353
+ modelValue: unref(getExampleFromSchema)(resolveSchema(bodyContent.schema), { xml: mediaType?.toString().includes("xml") }),
354
+ xml: mediaType?.toString().includes("xml")
355
+ }, null, 8, ["modelValue", "xml"])
355
356
  ], 64)) : createCommentVNode("", true)], 64);
356
357
  }), 128))])) : createCommentVNode("", true),
357
358
  entry.responses.length ? (openBlock(), createElementBlock("section", _hoisted_8, [_cache[20] || (_cache[20] = createElementVNode("h4", null, "Responses", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(entry.responses, (entryResponse) => {
@@ -360,9 +361,9 @@ var MarkdownReference_default = /* @__PURE__ */ defineComponent({
360
361
  createVNode(Schema_default, { schema: resolveSchema(responseContent.schema) }, null, 8, ["schema"]),
361
362
  _cache[19] || (_cache[19] = createElementVNode("p", null, [createElementVNode("strong", null, "Example:")], -1)),
362
363
  createVNode(XmlOrJson_default, {
363
- xml: mediaType?.toString().includes("xml"),
364
- "model-value": unref(getExampleFromSchema)(resolveSchema(responseContent.schema), { xml: mediaType?.toString().includes("xml") })
365
- }, null, 8, ["xml", "model-value"])
364
+ modelValue: unref(getExampleFromSchema)(resolveSchema(responseContent.schema), { xml: mediaType?.toString().includes("xml") }),
365
+ xml: mediaType?.toString().includes("xml")
366
+ }, null, 8, ["modelValue", "xml"])
366
367
  ], 64)) : createCommentVNode("", true)]);
367
368
  }), 128)) : createCommentVNode("", true)]);
368
369
  }), 128))])) : createCommentVNode("", true)
@@ -395,8 +396,8 @@ var MarkdownReference_default = /* @__PURE__ */ defineComponent({
395
396
  _cache[28] || (_cache[28] = createElementVNode("p", null, [createElementVNode("strong", null, "Example:")], -1)),
396
397
  getSchemaView(entry.schema).type === "object" ? (openBlock(), createBlock(XmlOrJson_default, {
397
398
  key: 2,
398
- "model-value": unref(getExampleFromSchema)(entry.schema)
399
- }, null, 8, ["model-value"])) : createCommentVNode("", true)
399
+ modelValue: unref(getExampleFromSchema)(entry.schema)
400
+ }, null, 8, ["modelValue"])) : createCommentVNode("", true)
400
401
  ]);
401
402
  }), 128))])) : createCommentVNode("", true)
402
403
  ]);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/components/Schema.vue","../src/components/Schema.vue","../src/components/XmlOrJson.vue","../src/components/XmlOrJson.vue","../src/components/MarkdownReference.vue","../src/components/MarkdownReference.vue","../src/create-markdown-from-openapi.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { MaybeRefSchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema'\n\nconst MAX_DEPTH = 10\n\nconst { schema, depth = 0 } = defineProps<{\n schema: MaybeRefSchemaObject\n depth?: number\n}>()\n\ntype ResolvedSchema = NonNullable<\n ReturnType<typeof resolve.schema<MaybeRefSchemaObject>>\n>\n\nconst resolvedSchema = resolve.schema(schema)\n\nconst resolveNestedSchema = (\n value: MaybeRefSchemaObject | undefined,\n): ResolvedSchema | undefined => resolve.schema(value)\n\nconst asObject = (value: unknown): Record<string, unknown> | undefined =>\n value !== null && typeof value === 'object'\n ? (value as Record<string, unknown>)\n : undefined\n\nconst getSchemaType = (\n value: ResolvedSchema | undefined,\n): string | string[] | undefined => {\n const schemaType = asObject(value)?.type\n if (typeof schemaType === 'string') {\n return schemaType\n }\n if (\n Array.isArray(schemaType) &&\n schemaType.every((entry) => typeof entry === 'string')\n ) {\n return schemaType\n }\n return undefined\n}\n\nconst getSchemaArray = (\n value: ResolvedSchema | undefined,\n key: 'allOf' | 'anyOf' | 'oneOf',\n): MaybeRefSchemaObject[] | undefined => {\n const collection = asObject(value)?.[key]\n if (!Array.isArray(collection)) {\n return undefined\n }\n return collection.filter(\n (entry): entry is MaybeRefSchemaObject =>\n entry !== null && typeof entry === 'object',\n )\n}\n\nconst getSchemaNot = (\n value: ResolvedSchema | undefined,\n): MaybeRefSchemaObject | undefined => {\n const notSchema = asObject(value)?.not\n return notSchema !== null && typeof notSchema === 'object'\n ? (notSchema as MaybeRefSchemaObject)\n : undefined\n}\n\nconst getSchemaProperties = (\n value: ResolvedSchema | undefined,\n): Record<string, MaybeRefSchemaObject> => {\n const properties = asObject(value)?.properties\n if (!properties || typeof properties !== 'object') {\n return {}\n }\n return Object.entries(properties).reduce<\n Record<string, MaybeRefSchemaObject>\n >((acc, [name, prop]) => {\n if (prop !== null && typeof prop === 'object') {\n acc[name] = prop as MaybeRefSchemaObject\n }\n return acc\n }, {})\n}\n\nconst getSchemaRequired = (value: ResolvedSchema | undefined): string[] => {\n const required = asObject(value)?.required\n if (!Array.isArray(required)) {\n return []\n }\n return required.filter((item): item is string => typeof item === 'string')\n}\n\nconst getSchemaItems = (\n value: ResolvedSchema | undefined,\n): MaybeRefSchemaObject | undefined => {\n const items = asObject(value)?.items\n return items !== null && typeof items === 'object'\n ? (items as MaybeRefSchemaObject)\n : undefined\n}\n\nconst getSchemaFormat = (\n value: ResolvedSchema | undefined,\n): string | undefined =>\n typeof asObject(value)?.format === 'string'\n ? (asObject(value)?.format as string)\n : undefined\n\nconst getSchemaEnum = (\n value: ResolvedSchema | undefined,\n): unknown[] | undefined => {\n const enumValues = asObject(value)?.enum\n return Array.isArray(enumValues) ? enumValues : undefined\n}\n\nconst getSchemaDefault = (value: ResolvedSchema | undefined): unknown =>\n asObject(value)?.default\n\nconst getSchemaDescription = (\n value: ResolvedSchema | undefined,\n): string | undefined =>\n typeof asObject(value)?.description === 'string'\n ? (asObject(value)?.description as string)\n : undefined\n\nconst getSchemaMinItems = (\n value: ResolvedSchema | undefined,\n): number | undefined =>\n typeof asObject(value)?.minItems === 'number'\n ? (asObject(value)?.minItems as number)\n : undefined\n\nconst getSchemaMaxItems = (\n value: ResolvedSchema | undefined,\n): number | undefined =>\n typeof asObject(value)?.maxItems === 'number'\n ? (asObject(value)?.maxItems as number)\n : undefined\n\nconst getSchemaUniqueItems = (\n value: ResolvedSchema | undefined,\n): boolean | undefined =>\n typeof asObject(value)?.uniqueItems === 'boolean'\n ? (asObject(value)?.uniqueItems as boolean)\n : undefined\n\nconst getResolvedSchemaType = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaType(resolveNestedSchema(value))\nconst getResolvedSchemaFormat = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaFormat(resolveNestedSchema(value))\nconst getResolvedSchemaEnum = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaEnum(resolveNestedSchema(value))\nconst getResolvedSchemaDefault = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaDefault(resolveNestedSchema(value))\nconst getResolvedSchemaDescription = (\n value: MaybeRefSchemaObject | undefined,\n) => getSchemaDescription(resolveNestedSchema(value))\nconst getResolvedSchemaProperties = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaProperties(resolveNestedSchema(value))\nconst getResolvedSchemaItems = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaItems(resolveNestedSchema(value))\n\nconst formatSchemaType = (value: MaybeRefSchemaObject | undefined): string => {\n const schemaType = getResolvedSchemaType(value)\n return Array.isArray(schemaType)\n ? schemaType.join(' | ')\n : schemaType || 'object'\n}\n\nconst formatEnumValues = (value: unknown[] | undefined): string =>\n value?.map((entry: unknown) => JSON.stringify(entry)).join(', ') || ''\n\n// Sort properties to show required fields first, then optional, then metadata\nconst sortProperties = (\n properties: Record<string, MaybeRefSchemaObject>,\n required?: string[],\n) => {\n const sorted = Object.entries(properties).sort(([a], [b]) => {\n const aRequired = required?.includes(a)\n const bRequired = required?.includes(b)\n if (aRequired && !bRequired) return -1\n if (!aRequired && bRequired) return 1\n return a.localeCompare(b)\n })\n return Object.fromEntries(sorted)\n}\n</script>\n\n<template>\n <section v-if=\"depth >= MAX_DEPTH\">\n <p><em>[Circular Reference]</em></p>\n </section>\n <section v-else-if=\"resolvedSchema\">\n <!-- Composition keywords -->\n <template v-if=\"getSchemaArray(resolvedSchema, 'allOf')\">\n <section>\n <header>\n <strong>All of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in getSchemaArray(resolvedSchema, 'allOf')\"\n :key=\"index\">\n <Schema\n :schema=\"subSchema\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"getSchemaArray(resolvedSchema, 'anyOf')\">\n <section>\n <header>\n <strong>Any of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in getSchemaArray(resolvedSchema, 'anyOf')\"\n :key=\"index\">\n <Schema\n :schema=\"subSchema\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"getSchemaArray(resolvedSchema, 'oneOf')\">\n <section>\n <header>\n <strong>One of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in getSchemaArray(resolvedSchema, 'oneOf')\"\n :key=\"index\">\n <Schema\n :schema=\"subSchema\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"getSchemaNot(resolvedSchema)\">\n <section>\n <header>\n <strong>Not:</strong>\n </header>\n <section>\n <Schema\n :schema=\"getSchemaNot(resolvedSchema)!\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <!-- Object type -->\n <template\n v-else-if=\"\n getSchemaType(resolvedSchema) === 'object' ||\n Object.keys(getSchemaProperties(resolvedSchema)).length\n \">\n <section>\n <ul>\n <template\n v-for=\"(propSchema, propName) in sortProperties(\n getSchemaProperties(resolvedSchema),\n getSchemaRequired(resolvedSchema),\n )\"\n :key=\"propName\">\n <li>\n <strong>\n <code>{{ propName }}</code>\n <span\n v-if=\"getSchemaRequired(resolvedSchema).includes(propName)\">\n (required)\n </span>\n </strong>\n <p>\n <code>\n {{ formatSchemaType(propSchema) }}\n </code>\n <template v-if=\"getResolvedSchemaFormat(propSchema)\">\n <span\n >, format:\n <code>{{ getResolvedSchemaFormat(propSchema) }}</code></span\n >\n </template>\n <template v-if=\"getResolvedSchemaEnum(propSchema)\">\n <span\n >, possible values:\n <code>{{\n formatEnumValues(getResolvedSchemaEnum(propSchema))\n }}</code>\n </span>\n </template>\n <template\n v-if=\"getResolvedSchemaDefault(propSchema) !== undefined\">\n <span\n >, default:\n <code>{{\n JSON.stringify(getResolvedSchemaDefault(propSchema))\n }}</code></span\n >\n </template>\n <template v-if=\"getResolvedSchemaDescription(propSchema)\">\n <span> — {{ getResolvedSchemaDescription(propSchema) }}</span>\n </template>\n </p>\n <Schema\n v-if=\"\n getResolvedSchemaType(propSchema) === 'object' ||\n Object.keys(getResolvedSchemaProperties(propSchema)).length\n \"\n :schema=\"propSchema\"\n :depth=\"depth + 1\" />\n <template\n v-if=\"\n getResolvedSchemaType(propSchema) === 'array' &&\n getResolvedSchemaItems(propSchema)\n \">\n <section>\n <header>\n <strong>Items:</strong>\n </header>\n <Schema\n :schema=\"getResolvedSchemaItems(propSchema)!\"\n :depth=\"depth + 1\" />\n </section>\n </template>\n </li>\n </template>\n </ul>\n </section>\n </template>\n\n <!-- Array type -->\n <template\n v-else-if=\"\n getSchemaType(resolvedSchema) === 'array' &&\n getSchemaItems(resolvedSchema)\n \">\n <section>\n <header>\n <strong>Array of:</strong>\n </header>\n <section>\n <Schema\n :schema=\"getSchemaItems(resolvedSchema)!\"\n :depth=\"depth + 1\" />\n </section>\n <ul\n v-if=\"\n getSchemaMinItems(resolvedSchema) !== undefined ||\n getSchemaMaxItems(resolvedSchema) !== undefined ||\n getSchemaUniqueItems(resolvedSchema)\n \">\n <li v-if=\"getSchemaMinItems(resolvedSchema) !== undefined\">\n Min items: <code>{{ getSchemaMinItems(resolvedSchema) }}</code>\n </li>\n <li v-if=\"getSchemaMaxItems(resolvedSchema) !== undefined\">\n Max items: <code>{{ getSchemaMaxItems(resolvedSchema) }}</code>\n </li>\n <li v-if=\"getSchemaUniqueItems(resolvedSchema)\">\n Unique items: <code>true</code>\n </li>\n </ul>\n </section>\n </template>\n\n <!-- Primitive types -->\n <template v-else>\n <section>\n <p>\n <code>{{ getSchemaType(resolvedSchema) }}</code>\n <template v-if=\"getSchemaFormat(resolvedSchema)\">\n <span\n >, format:\n <code>{{ getSchemaFormat(resolvedSchema) }}</code></span\n >\n </template>\n <template v-if=\"getSchemaEnum(resolvedSchema)\">\n <span\n >, possible values:\n <code>{{ formatEnumValues(getSchemaEnum(resolvedSchema)) }}</code>\n </span>\n </template>\n <template v-if=\"getSchemaDefault(resolvedSchema) !== undefined\">\n <span\n >, default:\n <code>{{\n JSON.stringify(getSchemaDefault(resolvedSchema))\n }}</code></span\n >\n </template>\n <template v-if=\"getSchemaDescription(resolvedSchema)\">\n <span> — {{ getSchemaDescription(resolvedSchema) }}</span>\n </template>\n </p>\n </section>\n </template>\n </section>\n</template>\n","<script setup lang=\"ts\">\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { MaybeRefSchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema'\n\nconst MAX_DEPTH = 10\n\nconst { schema, depth = 0 } = defineProps<{\n schema: MaybeRefSchemaObject\n depth?: number\n}>()\n\ntype ResolvedSchema = NonNullable<\n ReturnType<typeof resolve.schema<MaybeRefSchemaObject>>\n>\n\nconst resolvedSchema = resolve.schema(schema)\n\nconst resolveNestedSchema = (\n value: MaybeRefSchemaObject | undefined,\n): ResolvedSchema | undefined => resolve.schema(value)\n\nconst asObject = (value: unknown): Record<string, unknown> | undefined =>\n value !== null && typeof value === 'object'\n ? (value as Record<string, unknown>)\n : undefined\n\nconst getSchemaType = (\n value: ResolvedSchema | undefined,\n): string | string[] | undefined => {\n const schemaType = asObject(value)?.type\n if (typeof schemaType === 'string') {\n return schemaType\n }\n if (\n Array.isArray(schemaType) &&\n schemaType.every((entry) => typeof entry === 'string')\n ) {\n return schemaType\n }\n return undefined\n}\n\nconst getSchemaArray = (\n value: ResolvedSchema | undefined,\n key: 'allOf' | 'anyOf' | 'oneOf',\n): MaybeRefSchemaObject[] | undefined => {\n const collection = asObject(value)?.[key]\n if (!Array.isArray(collection)) {\n return undefined\n }\n return collection.filter(\n (entry): entry is MaybeRefSchemaObject =>\n entry !== null && typeof entry === 'object',\n )\n}\n\nconst getSchemaNot = (\n value: ResolvedSchema | undefined,\n): MaybeRefSchemaObject | undefined => {\n const notSchema = asObject(value)?.not\n return notSchema !== null && typeof notSchema === 'object'\n ? (notSchema as MaybeRefSchemaObject)\n : undefined\n}\n\nconst getSchemaProperties = (\n value: ResolvedSchema | undefined,\n): Record<string, MaybeRefSchemaObject> => {\n const properties = asObject(value)?.properties\n if (!properties || typeof properties !== 'object') {\n return {}\n }\n return Object.entries(properties).reduce<\n Record<string, MaybeRefSchemaObject>\n >((acc, [name, prop]) => {\n if (prop !== null && typeof prop === 'object') {\n acc[name] = prop as MaybeRefSchemaObject\n }\n return acc\n }, {})\n}\n\nconst getSchemaRequired = (value: ResolvedSchema | undefined): string[] => {\n const required = asObject(value)?.required\n if (!Array.isArray(required)) {\n return []\n }\n return required.filter((item): item is string => typeof item === 'string')\n}\n\nconst getSchemaItems = (\n value: ResolvedSchema | undefined,\n): MaybeRefSchemaObject | undefined => {\n const items = asObject(value)?.items\n return items !== null && typeof items === 'object'\n ? (items as MaybeRefSchemaObject)\n : undefined\n}\n\nconst getSchemaFormat = (\n value: ResolvedSchema | undefined,\n): string | undefined =>\n typeof asObject(value)?.format === 'string'\n ? (asObject(value)?.format as string)\n : undefined\n\nconst getSchemaEnum = (\n value: ResolvedSchema | undefined,\n): unknown[] | undefined => {\n const enumValues = asObject(value)?.enum\n return Array.isArray(enumValues) ? enumValues : undefined\n}\n\nconst getSchemaDefault = (value: ResolvedSchema | undefined): unknown =>\n asObject(value)?.default\n\nconst getSchemaDescription = (\n value: ResolvedSchema | undefined,\n): string | undefined =>\n typeof asObject(value)?.description === 'string'\n ? (asObject(value)?.description as string)\n : undefined\n\nconst getSchemaMinItems = (\n value: ResolvedSchema | undefined,\n): number | undefined =>\n typeof asObject(value)?.minItems === 'number'\n ? (asObject(value)?.minItems as number)\n : undefined\n\nconst getSchemaMaxItems = (\n value: ResolvedSchema | undefined,\n): number | undefined =>\n typeof asObject(value)?.maxItems === 'number'\n ? (asObject(value)?.maxItems as number)\n : undefined\n\nconst getSchemaUniqueItems = (\n value: ResolvedSchema | undefined,\n): boolean | undefined =>\n typeof asObject(value)?.uniqueItems === 'boolean'\n ? (asObject(value)?.uniqueItems as boolean)\n : undefined\n\nconst getResolvedSchemaType = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaType(resolveNestedSchema(value))\nconst getResolvedSchemaFormat = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaFormat(resolveNestedSchema(value))\nconst getResolvedSchemaEnum = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaEnum(resolveNestedSchema(value))\nconst getResolvedSchemaDefault = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaDefault(resolveNestedSchema(value))\nconst getResolvedSchemaDescription = (\n value: MaybeRefSchemaObject | undefined,\n) => getSchemaDescription(resolveNestedSchema(value))\nconst getResolvedSchemaProperties = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaProperties(resolveNestedSchema(value))\nconst getResolvedSchemaItems = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaItems(resolveNestedSchema(value))\n\nconst formatSchemaType = (value: MaybeRefSchemaObject | undefined): string => {\n const schemaType = getResolvedSchemaType(value)\n return Array.isArray(schemaType)\n ? schemaType.join(' | ')\n : schemaType || 'object'\n}\n\nconst formatEnumValues = (value: unknown[] | undefined): string =>\n value?.map((entry: unknown) => JSON.stringify(entry)).join(', ') || ''\n\n// Sort properties to show required fields first, then optional, then metadata\nconst sortProperties = (\n properties: Record<string, MaybeRefSchemaObject>,\n required?: string[],\n) => {\n const sorted = Object.entries(properties).sort(([a], [b]) => {\n const aRequired = required?.includes(a)\n const bRequired = required?.includes(b)\n if (aRequired && !bRequired) return -1\n if (!aRequired && bRequired) return 1\n return a.localeCompare(b)\n })\n return Object.fromEntries(sorted)\n}\n</script>\n\n<template>\n <section v-if=\"depth >= MAX_DEPTH\">\n <p><em>[Circular Reference]</em></p>\n </section>\n <section v-else-if=\"resolvedSchema\">\n <!-- Composition keywords -->\n <template v-if=\"getSchemaArray(resolvedSchema, 'allOf')\">\n <section>\n <header>\n <strong>All of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in getSchemaArray(resolvedSchema, 'allOf')\"\n :key=\"index\">\n <Schema\n :schema=\"subSchema\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"getSchemaArray(resolvedSchema, 'anyOf')\">\n <section>\n <header>\n <strong>Any of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in getSchemaArray(resolvedSchema, 'anyOf')\"\n :key=\"index\">\n <Schema\n :schema=\"subSchema\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"getSchemaArray(resolvedSchema, 'oneOf')\">\n <section>\n <header>\n <strong>One of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in getSchemaArray(resolvedSchema, 'oneOf')\"\n :key=\"index\">\n <Schema\n :schema=\"subSchema\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"getSchemaNot(resolvedSchema)\">\n <section>\n <header>\n <strong>Not:</strong>\n </header>\n <section>\n <Schema\n :schema=\"getSchemaNot(resolvedSchema)!\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <!-- Object type -->\n <template\n v-else-if=\"\n getSchemaType(resolvedSchema) === 'object' ||\n Object.keys(getSchemaProperties(resolvedSchema)).length\n \">\n <section>\n <ul>\n <template\n v-for=\"(propSchema, propName) in sortProperties(\n getSchemaProperties(resolvedSchema),\n getSchemaRequired(resolvedSchema),\n )\"\n :key=\"propName\">\n <li>\n <strong>\n <code>{{ propName }}</code>\n <span\n v-if=\"getSchemaRequired(resolvedSchema).includes(propName)\">\n (required)\n </span>\n </strong>\n <p>\n <code>\n {{ formatSchemaType(propSchema) }}\n </code>\n <template v-if=\"getResolvedSchemaFormat(propSchema)\">\n <span\n >, format:\n <code>{{ getResolvedSchemaFormat(propSchema) }}</code></span\n >\n </template>\n <template v-if=\"getResolvedSchemaEnum(propSchema)\">\n <span\n >, possible values:\n <code>{{\n formatEnumValues(getResolvedSchemaEnum(propSchema))\n }}</code>\n </span>\n </template>\n <template\n v-if=\"getResolvedSchemaDefault(propSchema) !== undefined\">\n <span\n >, default:\n <code>{{\n JSON.stringify(getResolvedSchemaDefault(propSchema))\n }}</code></span\n >\n </template>\n <template v-if=\"getResolvedSchemaDescription(propSchema)\">\n <span> — {{ getResolvedSchemaDescription(propSchema) }}</span>\n </template>\n </p>\n <Schema\n v-if=\"\n getResolvedSchemaType(propSchema) === 'object' ||\n Object.keys(getResolvedSchemaProperties(propSchema)).length\n \"\n :schema=\"propSchema\"\n :depth=\"depth + 1\" />\n <template\n v-if=\"\n getResolvedSchemaType(propSchema) === 'array' &&\n getResolvedSchemaItems(propSchema)\n \">\n <section>\n <header>\n <strong>Items:</strong>\n </header>\n <Schema\n :schema=\"getResolvedSchemaItems(propSchema)!\"\n :depth=\"depth + 1\" />\n </section>\n </template>\n </li>\n </template>\n </ul>\n </section>\n </template>\n\n <!-- Array type -->\n <template\n v-else-if=\"\n getSchemaType(resolvedSchema) === 'array' &&\n getSchemaItems(resolvedSchema)\n \">\n <section>\n <header>\n <strong>Array of:</strong>\n </header>\n <section>\n <Schema\n :schema=\"getSchemaItems(resolvedSchema)!\"\n :depth=\"depth + 1\" />\n </section>\n <ul\n v-if=\"\n getSchemaMinItems(resolvedSchema) !== undefined ||\n getSchemaMaxItems(resolvedSchema) !== undefined ||\n getSchemaUniqueItems(resolvedSchema)\n \">\n <li v-if=\"getSchemaMinItems(resolvedSchema) !== undefined\">\n Min items: <code>{{ getSchemaMinItems(resolvedSchema) }}</code>\n </li>\n <li v-if=\"getSchemaMaxItems(resolvedSchema) !== undefined\">\n Max items: <code>{{ getSchemaMaxItems(resolvedSchema) }}</code>\n </li>\n <li v-if=\"getSchemaUniqueItems(resolvedSchema)\">\n Unique items: <code>true</code>\n </li>\n </ul>\n </section>\n </template>\n\n <!-- Primitive types -->\n <template v-else>\n <section>\n <p>\n <code>{{ getSchemaType(resolvedSchema) }}</code>\n <template v-if=\"getSchemaFormat(resolvedSchema)\">\n <span\n >, format:\n <code>{{ getSchemaFormat(resolvedSchema) }}</code></span\n >\n </template>\n <template v-if=\"getSchemaEnum(resolvedSchema)\">\n <span\n >, possible values:\n <code>{{ formatEnumValues(getSchemaEnum(resolvedSchema)) }}</code>\n </span>\n </template>\n <template v-if=\"getSchemaDefault(resolvedSchema) !== undefined\">\n <span\n >, default:\n <code>{{\n JSON.stringify(getSchemaDefault(resolvedSchema))\n }}</code></span\n >\n </template>\n <template v-if=\"getSchemaDescription(resolvedSchema)\">\n <span> — {{ getSchemaDescription(resolvedSchema) }}</span>\n </template>\n </p>\n </section>\n </template>\n </section>\n</template>\n","<script setup lang=\"ts\">\nimport { json2xml } from '@scalar/helpers/file/json2xml'\nimport type { MaybeRefSchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema'\n\nwithDefaults(\n defineProps<{\n xml?: boolean\n modelValue: MaybeRefSchemaObject\n }>(),\n {\n xml: false,\n },\n)\n</script>\n<template>\n <template v-if=\"xml\">\n <pre><code class=\"language-xml\">{{ json2xml(modelValue) }}</code></pre>\n </template>\n <template v-else>\n <pre><code class=\"language-json\">{{ JSON.stringify(modelValue, null, 2) }}</code></pre>\n </template>\n</template>\n","<script setup lang=\"ts\">\nimport { json2xml } from '@scalar/helpers/file/json2xml'\nimport type { MaybeRefSchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema'\n\nwithDefaults(\n defineProps<{\n xml?: boolean\n modelValue: MaybeRefSchemaObject\n }>(),\n {\n xml: false,\n },\n)\n</script>\n<template>\n <template v-if=\"xml\">\n <pre><code class=\"language-xml\">{{ json2xml(modelValue) }}</code></pre>\n </template>\n <template v-else>\n <pre><code class=\"language-json\">{{ JSON.stringify(modelValue, null, 2) }}</code></pre>\n </template>\n</template>\n","<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components'\nimport { getExampleFromSchema } from '@scalar/oas-utils/spec-getters'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n OpenApiDocument,\n OperationObject,\n RequestBodyObject,\n ResponseObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\n// import { snippetz, type HarRequest } from '@scalar/snippetz'\n\nimport Schema from './Schema.vue'\nimport XmlOrJson from './XmlOrJson.vue'\n\ntype MarkdownDocument = Partial<OpenApiDocument> &\n Pick<OpenApiDocument, 'openapi' | 'info'>\ntype SchemaView = {\n description?: string\n title?: string\n type?: string | string[]\n}\ntype RequestBodyView = {\n content?: Record<string, { schema?: unknown }>\n}\ntype ResponseView = {\n description?: string\n content?: Record<string, { schema?: unknown }>\n}\n\ntype OperationEntry = {\n path: string\n method: string\n operation: OperationObject\n requestBody: RequestBodyView | null\n responses: Array<{\n statusCode: string\n response: ResponseView\n }>\n}\n\nconst { content } = defineProps<{\n content: MarkdownDocument\n}>()\n\n// const getRequestExample = (harRequest: Partial<HarRequest>) => {\n// const snippet = snippetz().print('shell', 'curl', {\n// httpVersion: 'HTTP/1.1',\n// headers: [],\n// queryString: [],\n// cookies: [],\n// headersSize: -1,\n// bodySize: -1,\n// method: 'get',\n// ...harRequest,\n// })\n\n// return snippet\n// }\n\nconst resolveRefAs = <TResolved extends object>(\n reference: unknown,\n): TResolved | null => {\n const resolved = getResolvedRef(reference as never)\n\n return resolved && typeof resolved === 'object'\n ? (resolved as TResolved)\n : null\n}\n\nconst resolveOperation = (operation: unknown): OperationObject | null =>\n resolveRefAs<OperationObject>(operation)\n\nconst resolveSchema = (schema: unknown): SchemaObject | null =>\n resolveRefAs<SchemaObject>(schema)\n\nconst resolveRequestBody = (body: unknown): RequestBodyObject | null =>\n resolveRefAs<RequestBodyObject>(body)\n\nconst resolveResponse = (response: unknown): ResponseObject | null =>\n resolveRefAs<ResponseObject>(response)\n\nconst toRequestBodyView = (body: unknown): RequestBodyView | null =>\n resolveRequestBody(body) as unknown as RequestBodyView | null\n\nconst toResponseView = (response: unknown): ResponseView | null =>\n resolveResponse(response) as unknown as ResponseView | null\n\nconst HTTP_METHODS = new Set([\n 'get',\n 'put',\n 'post',\n 'delete',\n 'options',\n 'head',\n 'patch',\n 'trace',\n])\n\nconst operations = computed<OperationEntry[]>(() => {\n const paths = content?.paths ?? {}\n\n return Object.entries(paths).flatMap(([path, pathItem]) => {\n if (!pathItem || typeof pathItem !== 'object') {\n return []\n }\n\n return Object.entries(pathItem).flatMap(([method, operation]) => {\n if (!HTTP_METHODS.has(method)) {\n return []\n }\n\n const resolvedOperation = resolveOperation(operation)\n\n if (!resolvedOperation) {\n return []\n }\n\n const requestBody = toRequestBodyView(resolvedOperation.requestBody)\n const responses = Object.entries(\n resolvedOperation.responses ?? {},\n ).flatMap(([statusCode, response]) => {\n const resolvedResponse = toResponseView(response)\n\n if (!resolvedResponse) {\n return []\n }\n\n return [{ statusCode, response: resolvedResponse }]\n })\n\n return [\n {\n path,\n method,\n operation: resolvedOperation,\n requestBody,\n responses,\n },\n ]\n })\n })\n})\n\nconst webhooks = computed(() => {\n const webhookItems = content?.webhooks ?? {}\n\n return Object.entries(webhookItems).flatMap(([name, pathItem]) => {\n if (!pathItem || typeof pathItem !== 'object') {\n return []\n }\n\n return Object.entries(pathItem).flatMap(([method, operation]) => {\n if (!HTTP_METHODS.has(method)) {\n return []\n }\n\n const resolvedOperation = resolveOperation(operation)\n\n if (!resolvedOperation) {\n return []\n }\n\n return [{ name, method, operation: resolvedOperation }]\n })\n })\n})\n\nconst componentSchemas = computed(() => {\n const schemas = content?.components?.schemas ?? {}\n\n return Object.entries(schemas).flatMap(([name, schema]) => {\n const resolvedSchema = resolveSchema(schema)\n\n if (!resolvedSchema) {\n return []\n }\n\n return [{ name, schema: resolvedSchema }]\n })\n})\n\nconst getSchemaView = (schema: SchemaObject): SchemaView =>\n schema as unknown as SchemaView\n</script>\n\n<template>\n <section>\n <header>\n <h1>{{ content?.info?.title }}</h1>\n <ul>\n <li>\n <strong>OpenAPI Version:</strong>&nbsp;<code>{{\n content?.openapi\n }}</code>\n </li>\n <li>\n <strong>API Version:</strong>&nbsp;<code>{{\n content?.info?.version\n }}</code>\n </li>\n </ul>\n </header>\n\n <ScalarMarkdown\n :value=\"content?.info?.description\"\n v-if=\"content?.info?.description\" />\n\n <section v-if=\"content?.servers?.length\">\n <h2>Servers</h2>\n <ul>\n <template\n v-for=\"server in content.servers\"\n :key=\"server.url\">\n <li>\n <strong>URL:</strong>&nbsp;<code>{{ server.url }}</code>\n <ul>\n <template v-if=\"server.description\">\n <li>\n <strong>Description:</strong>&nbsp;{{ server.description }}\n </li>\n </template>\n <template\n v-if=\"server.variables && Object.keys(server.variables).length\">\n <li>\n <strong>Variables:</strong>\n <ul>\n <template\n v-for=\"(variable, name) in server.variables\"\n :key=\"name\">\n <li>\n <code>{{ name }}</code> (default:\n <code>{{ variable.default }}</code\n >)<template v-if=\"variable.description\"\n >: {{ variable.description }}\n </template>\n </li>\n </template>\n </ul>\n </li>\n </template>\n </ul>\n </li>\n </template>\n </ul>\n </section>\n\n <section v-if=\"operations.length\">\n <h2>Operations</h2>\n\n <template\n v-for=\"entry in operations\"\n :key=\"`${entry.method}:${entry.path}`\">\n <section>\n <header>\n <h3>\n <template v-if=\"entry.operation.summary\">\n {{ entry.operation.summary }}\n </template>\n <template v-else>\n {{ entry.method.toString().toUpperCase() }} {{ entry.path }}\n </template>\n <template v-if=\"entry.operation['x-scalar-stability']\">\n ({{ entry.operation['x-scalar-stability'] }})\n </template>\n <template v-else-if=\"entry.operation.deprecated\">\n ⚠️ Deprecated\n </template>\n </h3>\n </header>\n\n <ul>\n <li>\n <strong>Method:</strong>&nbsp;<code>{{\n entry.method.toString().toUpperCase()\n }}</code>\n </li>\n <li>\n <strong>Path:</strong>&nbsp;<code>{{ entry.path }}</code>\n </li>\n <template v-if=\"entry.operation.tags\">\n <li>\n <strong>Tags:</strong>&nbsp;{{\n entry.operation.tags.join(', ')\n }}\n </li>\n </template>\n <template v-if=\"entry.operation['x-scalar-stability']\">\n <li>\n <strong>Stability:</strong>&nbsp;{{\n entry.operation['x-scalar-stability']\n }}\n </li>\n </template>\n </ul>\n\n <ScalarMarkdown :value=\"entry.operation.description\" />\n\n <!-- TODO: We need way more context to generate proper request examples -->\n <!-- <section>\n <h4>Request Example</h4>\n <pre><code>{{ getRequestExample({\n method: method.toString(),\n url: content.servers?.[0]?.url + path,\n }) }}</code></pre>\n </section> -->\n\n <template v-if=\"entry.requestBody?.content\">\n <section>\n <h4>Request Body</h4>\n <template\n v-for=\"(bodyContent, mediaType) in entry.requestBody.content\"\n :key=\"mediaType\">\n <h5>Content-Type: {{ mediaType }}</h5>\n <template v-if=\"resolveSchema(bodyContent.schema)\">\n <Schema :schema=\"resolveSchema(bodyContent.schema)!\" />\n <p><strong>Example:</strong></p>\n <XmlOrJson\n :xml=\"mediaType?.toString().includes('xml')\"\n :model-value=\"\n getExampleFromSchema(resolveSchema(bodyContent.schema)!, {\n xml: mediaType?.toString().includes('xml'),\n })\n \" />\n </template>\n </template>\n </section>\n </template>\n\n <template v-if=\"entry.responses.length\">\n <section>\n <h4>Responses</h4>\n\n <template\n v-for=\"entryResponse in entry.responses\"\n :key=\"entryResponse.statusCode\">\n <section>\n <header>\n <h5>\n Status: {{ entryResponse.statusCode }}\n <template v-if=\"entryResponse.response.description\">\n {{ entryResponse.response.description }}\n </template>\n </h5>\n </header>\n <template v-if=\"entryResponse.response.content\">\n <template\n v-for=\"(responseContent, mediaType) in entryResponse\n .response.content\"\n :key=\"mediaType\">\n <section>\n <h6>Content-Type: {{ mediaType }}</h6>\n <template v-if=\"resolveSchema(responseContent.schema)\">\n <Schema\n :schema=\"resolveSchema(responseContent.schema)!\" />\n <p><strong>Example:</strong></p>\n <XmlOrJson\n :xml=\"mediaType?.toString().includes('xml')\"\n :model-value=\"\n getExampleFromSchema(\n resolveSchema(responseContent.schema)!,\n {\n xml: mediaType?.toString().includes('xml'),\n },\n )\n \" />\n </template>\n </section>\n </template>\n </template>\n </section>\n </template>\n </section>\n </template>\n </section>\n </template>\n </section>\n\n <section v-if=\"webhooks.length\">\n <h2>Webhooks</h2>\n\n <template\n v-for=\"webhook in webhooks\"\n :key=\"`${webhook.name}:${webhook.method}`\">\n <section>\n <header>\n <h3>\n <template v-if=\"webhook.operation.summary\">\n {{ webhook.operation.summary }}\n </template>\n <template v-else>\n {{ webhook.name }}\n </template>\n <template v-if=\"webhook.operation['x-scalar-stability']\">\n <span>({{ webhook.operation['x-scalar-stability'] }})</span>\n </template>\n <template v-else-if=\"webhook.operation.deprecated\">\n <span>⚠️ Deprecated</span>\n </template>\n </h3>\n </header>\n\n <ul>\n <li>\n <strong>Method:</strong>\n <code>{{ webhook.method.toString().toUpperCase() }}</code>\n </li>\n <li>\n <strong>Path:</strong>\n <code>/webhooks/{{ webhook.name }}</code>\n </li>\n <template v-if=\"webhook.operation.tags\">\n <li>\n <strong>Tags:</strong>\n {{ webhook.operation.tags.join(', ') }}\n </li>\n </template>\n <template v-if=\"webhook.operation.deprecated\">\n <li><strong>Deprecated</strong></li>\n </template>\n </ul>\n\n <ScalarMarkdown :value=\"webhook.operation.description\" />\n\n <!-- TODO: We need way more context to generate proper request examples -->\n <!-- <section>\n <h4>Request Example</h4>\n <pre><code>{{ getRequestExample({\n method: method.toString(),\n url: content.servers?.[0]?.url + '/webhooks/' + name,\n }) }}</code></pre>\n </section> -->\n </section>\n </template>\n </section>\n\n <section v-if=\"componentSchemas.length\">\n <h2>Schemas</h2>\n <template\n v-for=\"entry in componentSchemas\"\n :key=\"entry.name\">\n <section>\n <header>\n <h3>{{ getSchemaView(entry.schema).title ?? entry.name }}</h3>\n </header>\n <ul>\n <li>\n <strong>Type:</strong>\n <code>{{ getSchemaView(entry.schema).type }}</code>\n </li>\n </ul>\n <template v-if=\"getSchemaView(entry.schema).description\">\n <ScalarMarkdown :value=\"getSchemaView(entry.schema).description\" />\n </template>\n <Schema\n v-if=\"getSchemaView(entry.schema).type === 'object'\"\n :schema=\"entry.schema\" />\n <p><strong>Example:</strong></p>\n <template v-if=\"getSchemaView(entry.schema).type === 'object'\">\n <XmlOrJson :model-value=\"getExampleFromSchema(entry.schema)\" />\n </template>\n </section>\n </template>\n </section>\n </section>\n</template>\n","<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components'\nimport { getExampleFromSchema } from '@scalar/oas-utils/spec-getters'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n OpenApiDocument,\n OperationObject,\n RequestBodyObject,\n ResponseObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\n// import { snippetz, type HarRequest } from '@scalar/snippetz'\n\nimport Schema from './Schema.vue'\nimport XmlOrJson from './XmlOrJson.vue'\n\ntype MarkdownDocument = Partial<OpenApiDocument> &\n Pick<OpenApiDocument, 'openapi' | 'info'>\ntype SchemaView = {\n description?: string\n title?: string\n type?: string | string[]\n}\ntype RequestBodyView = {\n content?: Record<string, { schema?: unknown }>\n}\ntype ResponseView = {\n description?: string\n content?: Record<string, { schema?: unknown }>\n}\n\ntype OperationEntry = {\n path: string\n method: string\n operation: OperationObject\n requestBody: RequestBodyView | null\n responses: Array<{\n statusCode: string\n response: ResponseView\n }>\n}\n\nconst { content } = defineProps<{\n content: MarkdownDocument\n}>()\n\n// const getRequestExample = (harRequest: Partial<HarRequest>) => {\n// const snippet = snippetz().print('shell', 'curl', {\n// httpVersion: 'HTTP/1.1',\n// headers: [],\n// queryString: [],\n// cookies: [],\n// headersSize: -1,\n// bodySize: -1,\n// method: 'get',\n// ...harRequest,\n// })\n\n// return snippet\n// }\n\nconst resolveRefAs = <TResolved extends object>(\n reference: unknown,\n): TResolved | null => {\n const resolved = getResolvedRef(reference as never)\n\n return resolved && typeof resolved === 'object'\n ? (resolved as TResolved)\n : null\n}\n\nconst resolveOperation = (operation: unknown): OperationObject | null =>\n resolveRefAs<OperationObject>(operation)\n\nconst resolveSchema = (schema: unknown): SchemaObject | null =>\n resolveRefAs<SchemaObject>(schema)\n\nconst resolveRequestBody = (body: unknown): RequestBodyObject | null =>\n resolveRefAs<RequestBodyObject>(body)\n\nconst resolveResponse = (response: unknown): ResponseObject | null =>\n resolveRefAs<ResponseObject>(response)\n\nconst toRequestBodyView = (body: unknown): RequestBodyView | null =>\n resolveRequestBody(body) as unknown as RequestBodyView | null\n\nconst toResponseView = (response: unknown): ResponseView | null =>\n resolveResponse(response) as unknown as ResponseView | null\n\nconst HTTP_METHODS = new Set([\n 'get',\n 'put',\n 'post',\n 'delete',\n 'options',\n 'head',\n 'patch',\n 'trace',\n])\n\nconst operations = computed<OperationEntry[]>(() => {\n const paths = content?.paths ?? {}\n\n return Object.entries(paths).flatMap(([path, pathItem]) => {\n if (!pathItem || typeof pathItem !== 'object') {\n return []\n }\n\n return Object.entries(pathItem).flatMap(([method, operation]) => {\n if (!HTTP_METHODS.has(method)) {\n return []\n }\n\n const resolvedOperation = resolveOperation(operation)\n\n if (!resolvedOperation) {\n return []\n }\n\n const requestBody = toRequestBodyView(resolvedOperation.requestBody)\n const responses = Object.entries(\n resolvedOperation.responses ?? {},\n ).flatMap(([statusCode, response]) => {\n const resolvedResponse = toResponseView(response)\n\n if (!resolvedResponse) {\n return []\n }\n\n return [{ statusCode, response: resolvedResponse }]\n })\n\n return [\n {\n path,\n method,\n operation: resolvedOperation,\n requestBody,\n responses,\n },\n ]\n })\n })\n})\n\nconst webhooks = computed(() => {\n const webhookItems = content?.webhooks ?? {}\n\n return Object.entries(webhookItems).flatMap(([name, pathItem]) => {\n if (!pathItem || typeof pathItem !== 'object') {\n return []\n }\n\n return Object.entries(pathItem).flatMap(([method, operation]) => {\n if (!HTTP_METHODS.has(method)) {\n return []\n }\n\n const resolvedOperation = resolveOperation(operation)\n\n if (!resolvedOperation) {\n return []\n }\n\n return [{ name, method, operation: resolvedOperation }]\n })\n })\n})\n\nconst componentSchemas = computed(() => {\n const schemas = content?.components?.schemas ?? {}\n\n return Object.entries(schemas).flatMap(([name, schema]) => {\n const resolvedSchema = resolveSchema(schema)\n\n if (!resolvedSchema) {\n return []\n }\n\n return [{ name, schema: resolvedSchema }]\n })\n})\n\nconst getSchemaView = (schema: SchemaObject): SchemaView =>\n schema as unknown as SchemaView\n</script>\n\n<template>\n <section>\n <header>\n <h1>{{ content?.info?.title }}</h1>\n <ul>\n <li>\n <strong>OpenAPI Version:</strong>&nbsp;<code>{{\n content?.openapi\n }}</code>\n </li>\n <li>\n <strong>API Version:</strong>&nbsp;<code>{{\n content?.info?.version\n }}</code>\n </li>\n </ul>\n </header>\n\n <ScalarMarkdown\n :value=\"content?.info?.description\"\n v-if=\"content?.info?.description\" />\n\n <section v-if=\"content?.servers?.length\">\n <h2>Servers</h2>\n <ul>\n <template\n v-for=\"server in content.servers\"\n :key=\"server.url\">\n <li>\n <strong>URL:</strong>&nbsp;<code>{{ server.url }}</code>\n <ul>\n <template v-if=\"server.description\">\n <li>\n <strong>Description:</strong>&nbsp;{{ server.description }}\n </li>\n </template>\n <template\n v-if=\"server.variables && Object.keys(server.variables).length\">\n <li>\n <strong>Variables:</strong>\n <ul>\n <template\n v-for=\"(variable, name) in server.variables\"\n :key=\"name\">\n <li>\n <code>{{ name }}</code> (default:\n <code>{{ variable.default }}</code\n >)<template v-if=\"variable.description\"\n >: {{ variable.description }}\n </template>\n </li>\n </template>\n </ul>\n </li>\n </template>\n </ul>\n </li>\n </template>\n </ul>\n </section>\n\n <section v-if=\"operations.length\">\n <h2>Operations</h2>\n\n <template\n v-for=\"entry in operations\"\n :key=\"`${entry.method}:${entry.path}`\">\n <section>\n <header>\n <h3>\n <template v-if=\"entry.operation.summary\">\n {{ entry.operation.summary }}\n </template>\n <template v-else>\n {{ entry.method.toString().toUpperCase() }} {{ entry.path }}\n </template>\n <template v-if=\"entry.operation['x-scalar-stability']\">\n ({{ entry.operation['x-scalar-stability'] }})\n </template>\n <template v-else-if=\"entry.operation.deprecated\">\n ⚠️ Deprecated\n </template>\n </h3>\n </header>\n\n <ul>\n <li>\n <strong>Method:</strong>&nbsp;<code>{{\n entry.method.toString().toUpperCase()\n }}</code>\n </li>\n <li>\n <strong>Path:</strong>&nbsp;<code>{{ entry.path }}</code>\n </li>\n <template v-if=\"entry.operation.tags\">\n <li>\n <strong>Tags:</strong>&nbsp;{{\n entry.operation.tags.join(', ')\n }}\n </li>\n </template>\n <template v-if=\"entry.operation['x-scalar-stability']\">\n <li>\n <strong>Stability:</strong>&nbsp;{{\n entry.operation['x-scalar-stability']\n }}\n </li>\n </template>\n </ul>\n\n <ScalarMarkdown :value=\"entry.operation.description\" />\n\n <!-- TODO: We need way more context to generate proper request examples -->\n <!-- <section>\n <h4>Request Example</h4>\n <pre><code>{{ getRequestExample({\n method: method.toString(),\n url: content.servers?.[0]?.url + path,\n }) }}</code></pre>\n </section> -->\n\n <template v-if=\"entry.requestBody?.content\">\n <section>\n <h4>Request Body</h4>\n <template\n v-for=\"(bodyContent, mediaType) in entry.requestBody.content\"\n :key=\"mediaType\">\n <h5>Content-Type: {{ mediaType }}</h5>\n <template v-if=\"resolveSchema(bodyContent.schema)\">\n <Schema :schema=\"resolveSchema(bodyContent.schema)!\" />\n <p><strong>Example:</strong></p>\n <XmlOrJson\n :xml=\"mediaType?.toString().includes('xml')\"\n :model-value=\"\n getExampleFromSchema(resolveSchema(bodyContent.schema)!, {\n xml: mediaType?.toString().includes('xml'),\n })\n \" />\n </template>\n </template>\n </section>\n </template>\n\n <template v-if=\"entry.responses.length\">\n <section>\n <h4>Responses</h4>\n\n <template\n v-for=\"entryResponse in entry.responses\"\n :key=\"entryResponse.statusCode\">\n <section>\n <header>\n <h5>\n Status: {{ entryResponse.statusCode }}\n <template v-if=\"entryResponse.response.description\">\n {{ entryResponse.response.description }}\n </template>\n </h5>\n </header>\n <template v-if=\"entryResponse.response.content\">\n <template\n v-for=\"(responseContent, mediaType) in entryResponse\n .response.content\"\n :key=\"mediaType\">\n <section>\n <h6>Content-Type: {{ mediaType }}</h6>\n <template v-if=\"resolveSchema(responseContent.schema)\">\n <Schema\n :schema=\"resolveSchema(responseContent.schema)!\" />\n <p><strong>Example:</strong></p>\n <XmlOrJson\n :xml=\"mediaType?.toString().includes('xml')\"\n :model-value=\"\n getExampleFromSchema(\n resolveSchema(responseContent.schema)!,\n {\n xml: mediaType?.toString().includes('xml'),\n },\n )\n \" />\n </template>\n </section>\n </template>\n </template>\n </section>\n </template>\n </section>\n </template>\n </section>\n </template>\n </section>\n\n <section v-if=\"webhooks.length\">\n <h2>Webhooks</h2>\n\n <template\n v-for=\"webhook in webhooks\"\n :key=\"`${webhook.name}:${webhook.method}`\">\n <section>\n <header>\n <h3>\n <template v-if=\"webhook.operation.summary\">\n {{ webhook.operation.summary }}\n </template>\n <template v-else>\n {{ webhook.name }}\n </template>\n <template v-if=\"webhook.operation['x-scalar-stability']\">\n <span>({{ webhook.operation['x-scalar-stability'] }})</span>\n </template>\n <template v-else-if=\"webhook.operation.deprecated\">\n <span>⚠️ Deprecated</span>\n </template>\n </h3>\n </header>\n\n <ul>\n <li>\n <strong>Method:</strong>\n <code>{{ webhook.method.toString().toUpperCase() }}</code>\n </li>\n <li>\n <strong>Path:</strong>\n <code>/webhooks/{{ webhook.name }}</code>\n </li>\n <template v-if=\"webhook.operation.tags\">\n <li>\n <strong>Tags:</strong>\n {{ webhook.operation.tags.join(', ') }}\n </li>\n </template>\n <template v-if=\"webhook.operation.deprecated\">\n <li><strong>Deprecated</strong></li>\n </template>\n </ul>\n\n <ScalarMarkdown :value=\"webhook.operation.description\" />\n\n <!-- TODO: We need way more context to generate proper request examples -->\n <!-- <section>\n <h4>Request Example</h4>\n <pre><code>{{ getRequestExample({\n method: method.toString(),\n url: content.servers?.[0]?.url + '/webhooks/' + name,\n }) }}</code></pre>\n </section> -->\n </section>\n </template>\n </section>\n\n <section v-if=\"componentSchemas.length\">\n <h2>Schemas</h2>\n <template\n v-for=\"entry in componentSchemas\"\n :key=\"entry.name\">\n <section>\n <header>\n <h3>{{ getSchemaView(entry.schema).title ?? entry.name }}</h3>\n </header>\n <ul>\n <li>\n <strong>Type:</strong>\n <code>{{ getSchemaView(entry.schema).type }}</code>\n </li>\n </ul>\n <template v-if=\"getSchemaView(entry.schema).description\">\n <ScalarMarkdown :value=\"getSchemaView(entry.schema).description\" />\n </template>\n <Schema\n v-if=\"getSchemaView(entry.schema).type === 'object'\"\n :schema=\"entry.schema\" />\n <p><strong>Example:</strong></p>\n <template v-if=\"getSchemaView(entry.schema).type === 'object'\">\n <XmlOrJson :model-value=\"getExampleFromSchema(entry.schema)\" />\n </template>\n </section>\n </template>\n </section>\n </section>\n</template>\n","import { isObject } from '@scalar/helpers/object/is-object'\nimport { readFiles } from '@scalar/json-magic/bundle/plugins/node'\nimport { normalize } from '@scalar/json-magic/helpers/normalize'\nimport type { OpenApiDocument, PathItemObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { createWorkspaceStore } from '@scalar/workspace-store/client'\nimport { minify } from 'html-minifier-terser'\nimport rehypeParse from 'rehype-parse'\nimport rehypeRemark from 'rehype-remark'\nimport rehypeSanitize from 'rehype-sanitize'\nimport remarkGfm from 'remark-gfm'\nimport remarkStringify from 'remark-stringify'\nimport { unified } from 'unified'\nimport { createSSRApp } from 'vue'\nimport { renderToString } from 'vue/server-renderer'\n\nimport MarkdownReference from './components/MarkdownReference.vue'\n\ntype AnyDocument = OpenApiDocument | Record<string, unknown> | string\ntype HttpMethodKeys = Exclude<keyof PathItemObject, '$ref' | 'summary' | 'description' | 'servers' | 'parameters'>\nexport type HttpMethod = Extract<HttpMethodKeys, string>\nexport type OperationSelector =\n | {\n path: string\n method: HttpMethod | Uppercase<HttpMethod>\n }\n | {\n operationId: string\n }\n | {\n pointer: string\n }\nexport type OpenApiRenderOptions = {\n operation?: OperationSelector\n}\ntype WorkspaceInput =\n | {\n document: Record<string, unknown>\n }\n | {\n url: string\n }\n | {\n path: string\n }\ntype OperationMatch = {\n path: string\n method: HttpMethod\n}\n\nconst HTTP_METHODS: HttpMethod[] = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace']\nconst HTTP_METHOD_SET = new Set<string>(HTTP_METHODS)\n\nconst isHttpUrl = (value: string): boolean => {\n try {\n const url = new URL(value)\n return url.protocol === 'http:' || url.protocol === 'https:'\n } catch {\n return false\n }\n}\n\nconst toWorkspaceInput = (input: AnyDocument): WorkspaceInput => {\n if (typeof input !== 'string') {\n return { document: input as Record<string, unknown> }\n }\n\n const normalized = normalize(input)\n\n if (isObject(normalized)) {\n return { document: normalized as Record<string, unknown> }\n }\n\n if (isHttpUrl(input)) {\n return { url: input }\n }\n\n return { path: input }\n}\n\nconst normalizeHttpMethod = (method: string): HttpMethod | null => {\n const normalized = method.toLowerCase()\n\n if (HTTP_METHOD_SET.has(normalized)) {\n return normalized as HttpMethod\n }\n\n return null\n}\n\nconst normalizeJsonPointer = (pointer: string): string => {\n if (pointer.startsWith('#/')) {\n return pointer.slice(1)\n }\n\n if (pointer.startsWith('/')) {\n return pointer\n }\n\n throw new Error(`Invalid JSON pointer \"${pointer}\". JSON pointers must start with \"#/\"`)\n}\n\nconst parseJsonPointer = (pointer: string): string[] =>\n normalizeJsonPointer(pointer)\n .slice(1)\n .split('/')\n .map((segment) => segment.replaceAll('~1', '/').replaceAll('~0', '~'))\n\nconst getOperationSelectorFromPointer = (pointer: string): Extract<OperationSelector, { path: string }> => {\n const segments = parseJsonPointer(pointer)\n\n if (segments.length !== 3 || segments[0] !== 'paths') {\n throw new Error(`JSON pointer \"${pointer}\" must target an operation object under \"/paths/{path}/{method}\"`)\n }\n\n const path = segments[1]\n const method = segments[2]\n\n if (!path || !method) {\n throw new Error(`JSON pointer \"${pointer}\" must target an operation object under \"/paths/{path}/{method}\"`)\n }\n\n return {\n path,\n method: method as HttpMethod,\n }\n}\n\nconst getPathEntries = (document: OpenApiDocument): Array<[string, PathItemObject]> => {\n const paths = document.paths\n\n if (!isObject(paths)) {\n return []\n }\n\n return Object.entries(paths).flatMap(([path, pathItem]) =>\n isObject(pathItem) ? [[path, pathItem as PathItemObject]] : [],\n )\n}\n\nconst filterPathItemToSingleOperation = (pathItem: PathItemObject, selectedMethod: HttpMethod): PathItemObject =>\n Object.fromEntries(\n Object.entries(pathItem).filter(([key]) => {\n const method = normalizeHttpMethod(key)\n return !method || method === selectedMethod\n }),\n )\n\nconst findOperationByPathAndMethod = (\n document: OpenApiDocument,\n selector: Extract<OperationSelector, { path: string }>,\n): OperationMatch => {\n const method = normalizeHttpMethod(selector.method)\n\n if (!method) {\n throw new Error(`Invalid HTTP method \"${selector.method}\". Supported methods: ${HTTP_METHODS.join(', ')}`)\n }\n\n const pathEntries = getPathEntries(document)\n const pathItem = pathEntries.find(([path]) => path === selector.path)?.[1]\n\n if (!pathItem || !(method in pathItem)) {\n throw new Error(`Operation not found for path \"${selector.path}\" and method \"${method.toUpperCase()}\"`)\n }\n\n return {\n path: selector.path,\n method,\n }\n}\n\nconst findOperationsByOperationId = (document: OpenApiDocument, operationId: string): OperationMatch[] =>\n getPathEntries(document).flatMap(([path, pathItem]) =>\n Object.entries(pathItem).flatMap(([methodKey, operation]) => {\n const method = normalizeHttpMethod(methodKey)\n\n if (!method || !isObject(operation)) {\n return []\n }\n\n const candidateOperationId =\n 'operationId' in operation && typeof operation.operationId === 'string' ? operation.operationId : undefined\n\n if (candidateOperationId !== operationId) {\n return []\n }\n\n return [{ path, method }]\n }),\n )\n\nconst resolveOperationMatch = (document: OpenApiDocument, selector: OperationSelector): OperationMatch => {\n if ('pointer' in selector) {\n return findOperationByPathAndMethod(document, getOperationSelectorFromPointer(selector.pointer))\n }\n\n if ('operationId' in selector) {\n const matches = findOperationsByOperationId(document, selector.operationId)\n\n if (!matches.length) {\n throw new Error(`Operation with operationId \"${selector.operationId}\" was not found`)\n }\n\n if (matches.length > 1) {\n const uniqueCandidates = matches.map(({ path, method }) => `\"${method.toUpperCase()} ${path}\"`)\n\n throw new Error(\n `Multiple operations found for operationId \"${selector.operationId}\". Use { path, method } instead. Matches: ${uniqueCandidates.join(', ')}`,\n )\n }\n\n return matches[0] as OperationMatch\n }\n\n return findOperationByPathAndMethod(document, selector)\n}\n\nconst filterDocumentByOperation = (document: OpenApiDocument, selector: OperationSelector): OpenApiDocument => {\n const match = resolveOperationMatch(document, selector)\n const pathItem = getPathEntries(document).find(([path]) => path === match.path)?.[1]\n\n if (!pathItem) {\n throw new Error(`Operation not found for path \"${match.path}\" and method \"${match.method.toUpperCase()}\"`)\n }\n\n return {\n ...document,\n paths: {\n [match.path]: filterPathItemToSingleOperation(pathItem, match.method),\n },\n }\n}\n\nexport async function createHtmlFromOpenApi(input: AnyDocument, options?: OpenApiRenderOptions) {\n const workspaceStore = createWorkspaceStore({\n fileLoader: readFiles(),\n })\n\n const name = 'openapi-to-markdown'\n const loaded = await workspaceStore.addDocument({\n name,\n ...toWorkspaceInput(input),\n })\n\n if (!loaded) {\n throw new Error('Failed to load OpenAPI document')\n }\n\n const content = workspaceStore.workspace.documents[name]\n\n if (!content) {\n throw new Error('OpenAPI document could not be resolved')\n }\n\n const renderedContent =\n options?.operation && isObject(content)\n ? filterDocumentByOperation(content as OpenApiDocument, options.operation)\n : content\n\n // Create and configure a server-side rendered Vue app\n const app = createSSRApp(MarkdownReference, {\n content: renderedContent,\n })\n\n // Get static HTML\n const html = await renderToString(app)\n\n // Clean the output\n return minify(html, {\n removeComments: true,\n removeEmptyElements: true,\n collapseWhitespace: true,\n continueOnParseError: true,\n noNewlinesBeforeTagClose: true,\n preserveLineBreaks: true,\n removeEmptyAttributes: true,\n decodeEntities: true,\n useShortDoctype: true,\n })\n}\n\nexport async function createMarkdownFromOpenApi(content: AnyDocument, options?: OpenApiRenderOptions) {\n return markdownFromHtml(await createHtmlFromOpenApi(content, options))\n}\n\nasync function markdownFromHtml(html: string): Promise<string> {\n const file = await unified()\n .use(rehypeParse, { fragment: true })\n .use(remarkGfm)\n .use(rehypeSanitize)\n .use(rehypeRemark)\n .use(remarkStringify, {\n bullet: '-',\n })\n .process(html)\n\n return String(file)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACIA,IAAM,YAAY;;;;;;;;;;EAWlB,MAAM,iBAAiB,QAAQ,OAAO,QAAA,OAAM;EAE5C,MAAM,uBACJ,UAC+B,QAAQ,OAAO,MAAK;EAErD,MAAM,YAAY,UAChB,UAAU,QAAQ,OAAO,UAAU,WAC9B,QACD,KAAA;EAEN,MAAM,iBACJ,UACkC;GAClC,MAAM,aAAa,SAAS,MAAM,EAAE;AACpC,OAAI,OAAO,eAAe,SACxB,QAAO;AAET,OACE,MAAM,QAAQ,WAAW,IACzB,WAAW,OAAO,UAAU,OAAO,UAAU,SAAQ,CAErD,QAAO;;EAKX,MAAM,kBACJ,OACA,QACuC;GACvC,MAAM,aAAa,SAAS,MAAM,GAAG;AACrC,OAAI,CAAC,MAAM,QAAQ,WAAW,CAC5B;AAEF,UAAO,WAAW,QACf,UACC,UAAU,QAAQ,OAAO,UAAU,SACvC;;EAGF,MAAM,gBACJ,UACqC;GACrC,MAAM,YAAY,SA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AS,QAAQ,GACnC,0BAA0B,SAA4B,QAAQ,UAAU,GACxE,SAKL,CAAC,CAGoC,EAGlB;EAClB,gBAAgB;EAChB,qBAAqB;EACrB,oBAAoB;EACpB,sBAAsB;EACtB,0BAA0B;EAC1B,oBAAoB;EACpB,uBAAuB;EACvB,gBAAgB;EAChB,iBAAiB;EAClB,CAAC;;AAGJ,eAAsB,0BAA0B,SAAsB,SAAgC;AACpG,QAAO,iBAAiB,MAAM,sBAAsB,SAAS,QAAQ,CAAC;;AAGxE,eAAe,iBAAiB,MAA+B;CAC7D,MAAM,OAAO,MAAM,SAAS,CACzB,IAAI,aAAa,EAAE,UAAU,MAAM,CAAC,CACpC,IAAI,UAAU,CACd,IAAI,eAAe,CACnB,IAAI,aAAa,CACjB,IAAI,iBAAiB,EACpB,QAAQ,KACT,CAAC,CACD,QAAQ,KAAK;AAEhB,QAAO,OAAO,KAAK"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/components/Schema.vue","../src/components/Schema.vue","../src/components/XmlOrJson.vue","../src/components/XmlOrJson.vue","../src/components/MarkdownReference.vue","../src/components/MarkdownReference.vue","../src/create-markdown-from-openapi.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { MaybeRefSchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema'\n\nconst MAX_DEPTH = 10\n\nconst { schema, depth = 0 } = defineProps<{\n schema: MaybeRefSchemaObject\n depth?: number\n}>()\n\ntype ResolvedSchema = NonNullable<\n ReturnType<typeof resolve.schema<MaybeRefSchemaObject>>\n>\n\nconst resolvedSchema = resolve.schema(schema)\n\nconst resolveNestedSchema = (\n value: MaybeRefSchemaObject | undefined,\n): ResolvedSchema | undefined => resolve.schema(value)\n\nconst asObject = (value: unknown): Record<string, unknown> | undefined =>\n value !== null && typeof value === 'object'\n ? (value as Record<string, unknown>)\n : undefined\n\nconst getSchemaType = (\n value: ResolvedSchema | undefined,\n): string | string[] | undefined => {\n const schemaType = asObject(value)?.type\n if (typeof schemaType === 'string') {\n return schemaType\n }\n if (\n Array.isArray(schemaType) &&\n schemaType.every((entry) => typeof entry === 'string')\n ) {\n return schemaType\n }\n return undefined\n}\n\nconst getSchemaArray = (\n value: ResolvedSchema | undefined,\n key: 'allOf' | 'anyOf' | 'oneOf',\n): MaybeRefSchemaObject[] | undefined => {\n const collection = asObject(value)?.[key]\n if (!Array.isArray(collection)) {\n return undefined\n }\n return collection.filter(\n (entry): entry is MaybeRefSchemaObject =>\n entry !== null && typeof entry === 'object',\n )\n}\n\nconst getSchemaNot = (\n value: ResolvedSchema | undefined,\n): MaybeRefSchemaObject | undefined => {\n const notSchema = asObject(value)?.not\n return notSchema !== null && typeof notSchema === 'object'\n ? (notSchema as MaybeRefSchemaObject)\n : undefined\n}\n\nconst getSchemaProperties = (\n value: ResolvedSchema | undefined,\n): Record<string, MaybeRefSchemaObject> => {\n const properties = asObject(value)?.properties\n if (!properties || typeof properties !== 'object') {\n return {}\n }\n return Object.entries(properties).reduce<\n Record<string, MaybeRefSchemaObject>\n >((acc, [name, prop]) => {\n if (prop !== null && typeof prop === 'object') {\n acc[name] = prop as MaybeRefSchemaObject\n }\n return acc\n }, {})\n}\n\nconst getSchemaRequired = (value: ResolvedSchema | undefined): string[] => {\n const required = asObject(value)?.required\n if (!Array.isArray(required)) {\n return []\n }\n return required.filter((item): item is string => typeof item === 'string')\n}\n\nconst getSchemaItems = (\n value: ResolvedSchema | undefined,\n): MaybeRefSchemaObject | undefined => {\n const items = asObject(value)?.items\n return items !== null && typeof items === 'object'\n ? (items as MaybeRefSchemaObject)\n : undefined\n}\n\nconst getSchemaFormat = (\n value: ResolvedSchema | undefined,\n): string | undefined =>\n typeof asObject(value)?.format === 'string'\n ? (asObject(value)?.format as string)\n : undefined\n\nconst getSchemaEnum = (\n value: ResolvedSchema | undefined,\n): unknown[] | undefined => {\n const enumValues = asObject(value)?.enum\n return Array.isArray(enumValues) ? enumValues : undefined\n}\n\nconst getSchemaDefault = (value: ResolvedSchema | undefined): unknown =>\n asObject(value)?.default\n\nconst getSchemaDescription = (\n value: ResolvedSchema | undefined,\n): string | undefined =>\n typeof asObject(value)?.description === 'string'\n ? (asObject(value)?.description as string)\n : undefined\n\nconst getSchemaMinItems = (\n value: ResolvedSchema | undefined,\n): number | undefined =>\n typeof asObject(value)?.minItems === 'number'\n ? (asObject(value)?.minItems as number)\n : undefined\n\nconst getSchemaMaxItems = (\n value: ResolvedSchema | undefined,\n): number | undefined =>\n typeof asObject(value)?.maxItems === 'number'\n ? (asObject(value)?.maxItems as number)\n : undefined\n\nconst getSchemaUniqueItems = (\n value: ResolvedSchema | undefined,\n): boolean | undefined =>\n typeof asObject(value)?.uniqueItems === 'boolean'\n ? (asObject(value)?.uniqueItems as boolean)\n : undefined\n\nconst getResolvedSchemaType = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaType(resolveNestedSchema(value))\nconst getResolvedSchemaFormat = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaFormat(resolveNestedSchema(value))\nconst getResolvedSchemaEnum = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaEnum(resolveNestedSchema(value))\nconst getResolvedSchemaDefault = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaDefault(resolveNestedSchema(value))\nconst getResolvedSchemaDescription = (\n value: MaybeRefSchemaObject | undefined,\n) => getSchemaDescription(resolveNestedSchema(value))\nconst getResolvedSchemaProperties = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaProperties(resolveNestedSchema(value))\nconst getResolvedSchemaItems = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaItems(resolveNestedSchema(value))\n\nconst formatSchemaType = (value: MaybeRefSchemaObject | undefined): string => {\n const schemaType = getResolvedSchemaType(value)\n return Array.isArray(schemaType)\n ? schemaType.join(' | ')\n : schemaType || 'object'\n}\n\nconst formatEnumValues = (value: unknown[] | undefined): string =>\n value?.map((entry: unknown) => JSON.stringify(entry)).join(', ') || ''\n\n// Sort properties to show required fields first, then optional, then metadata\nconst sortProperties = (\n properties: Record<string, MaybeRefSchemaObject>,\n required?: string[],\n) => {\n const sorted = Object.entries(properties).sort(([a], [b]) => {\n const aRequired = required?.includes(a)\n const bRequired = required?.includes(b)\n if (aRequired && !bRequired) return -1\n if (!aRequired && bRequired) return 1\n return a.localeCompare(b)\n })\n return Object.fromEntries(sorted)\n}\n</script>\n\n<template>\n <section v-if=\"depth >= MAX_DEPTH\">\n <p><em>[Circular Reference]</em></p>\n </section>\n <section v-else-if=\"resolvedSchema\">\n <!-- Composition keywords -->\n <template v-if=\"getSchemaArray(resolvedSchema, 'allOf')\">\n <section>\n <header>\n <strong>All of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in getSchemaArray(resolvedSchema, 'allOf')\"\n :key=\"index\">\n <Schema\n :schema=\"subSchema\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"getSchemaArray(resolvedSchema, 'anyOf')\">\n <section>\n <header>\n <strong>Any of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in getSchemaArray(resolvedSchema, 'anyOf')\"\n :key=\"index\">\n <Schema\n :schema=\"subSchema\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"getSchemaArray(resolvedSchema, 'oneOf')\">\n <section>\n <header>\n <strong>One of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in getSchemaArray(resolvedSchema, 'oneOf')\"\n :key=\"index\">\n <Schema\n :schema=\"subSchema\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"getSchemaNot(resolvedSchema)\">\n <section>\n <header>\n <strong>Not:</strong>\n </header>\n <section>\n <Schema\n :schema=\"getSchemaNot(resolvedSchema)!\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <!-- Object type -->\n <template\n v-else-if=\"\n getSchemaType(resolvedSchema) === 'object' ||\n Object.keys(getSchemaProperties(resolvedSchema)).length\n \">\n <section>\n <ul>\n <template\n v-for=\"(propSchema, propName) in sortProperties(\n getSchemaProperties(resolvedSchema),\n getSchemaRequired(resolvedSchema),\n )\"\n :key=\"propName\">\n <li>\n <strong>\n <code>{{ propName }}</code>\n <span\n v-if=\"getSchemaRequired(resolvedSchema).includes(propName)\">\n (required)\n </span>\n </strong>\n <p>\n <code>\n {{ formatSchemaType(propSchema) }}\n </code>\n <template v-if=\"getResolvedSchemaFormat(propSchema)\">\n <span\n >, format:\n <code>{{ getResolvedSchemaFormat(propSchema) }}</code></span\n >\n </template>\n <template v-if=\"getResolvedSchemaEnum(propSchema)\">\n <span\n >, possible values:\n <code>{{\n formatEnumValues(getResolvedSchemaEnum(propSchema))\n }}</code>\n </span>\n </template>\n <template\n v-if=\"getResolvedSchemaDefault(propSchema) !== undefined\">\n <span\n >, default:\n <code>{{\n JSON.stringify(getResolvedSchemaDefault(propSchema))\n }}</code></span\n >\n </template>\n <template v-if=\"getResolvedSchemaDescription(propSchema)\">\n <span> — {{ getResolvedSchemaDescription(propSchema) }}</span>\n </template>\n </p>\n <Schema\n v-if=\"\n getResolvedSchemaType(propSchema) === 'object' ||\n Object.keys(getResolvedSchemaProperties(propSchema)).length\n \"\n :schema=\"propSchema\"\n :depth=\"depth + 1\" />\n <template\n v-if=\"\n getResolvedSchemaType(propSchema) === 'array' &&\n getResolvedSchemaItems(propSchema)\n \">\n <section>\n <header>\n <strong>Items:</strong>\n </header>\n <Schema\n :schema=\"getResolvedSchemaItems(propSchema)!\"\n :depth=\"depth + 1\" />\n </section>\n </template>\n </li>\n </template>\n </ul>\n </section>\n </template>\n\n <!-- Array type -->\n <template\n v-else-if=\"\n getSchemaType(resolvedSchema) === 'array' &&\n getSchemaItems(resolvedSchema)\n \">\n <section>\n <header>\n <strong>Array of:</strong>\n </header>\n <section>\n <Schema\n :schema=\"getSchemaItems(resolvedSchema)!\"\n :depth=\"depth + 1\" />\n </section>\n <ul\n v-if=\"\n getSchemaMinItems(resolvedSchema) !== undefined ||\n getSchemaMaxItems(resolvedSchema) !== undefined ||\n getSchemaUniqueItems(resolvedSchema)\n \">\n <li v-if=\"getSchemaMinItems(resolvedSchema) !== undefined\">\n Min items: <code>{{ getSchemaMinItems(resolvedSchema) }}</code>\n </li>\n <li v-if=\"getSchemaMaxItems(resolvedSchema) !== undefined\">\n Max items: <code>{{ getSchemaMaxItems(resolvedSchema) }}</code>\n </li>\n <li v-if=\"getSchemaUniqueItems(resolvedSchema)\">\n Unique items: <code>true</code>\n </li>\n </ul>\n </section>\n </template>\n\n <!-- Primitive types -->\n <template v-else>\n <section>\n <p>\n <code>{{ getSchemaType(resolvedSchema) }}</code>\n <template v-if=\"getSchemaFormat(resolvedSchema)\">\n <span\n >, format:\n <code>{{ getSchemaFormat(resolvedSchema) }}</code></span\n >\n </template>\n <template v-if=\"getSchemaEnum(resolvedSchema)\">\n <span\n >, possible values:\n <code>{{ formatEnumValues(getSchemaEnum(resolvedSchema)) }}</code>\n </span>\n </template>\n <template v-if=\"getSchemaDefault(resolvedSchema) !== undefined\">\n <span\n >, default:\n <code>{{\n JSON.stringify(getSchemaDefault(resolvedSchema))\n }}</code></span\n >\n </template>\n <template v-if=\"getSchemaDescription(resolvedSchema)\">\n <span> — {{ getSchemaDescription(resolvedSchema) }}</span>\n </template>\n </p>\n </section>\n </template>\n </section>\n</template>\n","<script setup lang=\"ts\">\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { MaybeRefSchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema'\n\nconst MAX_DEPTH = 10\n\nconst { schema, depth = 0 } = defineProps<{\n schema: MaybeRefSchemaObject\n depth?: number\n}>()\n\ntype ResolvedSchema = NonNullable<\n ReturnType<typeof resolve.schema<MaybeRefSchemaObject>>\n>\n\nconst resolvedSchema = resolve.schema(schema)\n\nconst resolveNestedSchema = (\n value: MaybeRefSchemaObject | undefined,\n): ResolvedSchema | undefined => resolve.schema(value)\n\nconst asObject = (value: unknown): Record<string, unknown> | undefined =>\n value !== null && typeof value === 'object'\n ? (value as Record<string, unknown>)\n : undefined\n\nconst getSchemaType = (\n value: ResolvedSchema | undefined,\n): string | string[] | undefined => {\n const schemaType = asObject(value)?.type\n if (typeof schemaType === 'string') {\n return schemaType\n }\n if (\n Array.isArray(schemaType) &&\n schemaType.every((entry) => typeof entry === 'string')\n ) {\n return schemaType\n }\n return undefined\n}\n\nconst getSchemaArray = (\n value: ResolvedSchema | undefined,\n key: 'allOf' | 'anyOf' | 'oneOf',\n): MaybeRefSchemaObject[] | undefined => {\n const collection = asObject(value)?.[key]\n if (!Array.isArray(collection)) {\n return undefined\n }\n return collection.filter(\n (entry): entry is MaybeRefSchemaObject =>\n entry !== null && typeof entry === 'object',\n )\n}\n\nconst getSchemaNot = (\n value: ResolvedSchema | undefined,\n): MaybeRefSchemaObject | undefined => {\n const notSchema = asObject(value)?.not\n return notSchema !== null && typeof notSchema === 'object'\n ? (notSchema as MaybeRefSchemaObject)\n : undefined\n}\n\nconst getSchemaProperties = (\n value: ResolvedSchema | undefined,\n): Record<string, MaybeRefSchemaObject> => {\n const properties = asObject(value)?.properties\n if (!properties || typeof properties !== 'object') {\n return {}\n }\n return Object.entries(properties).reduce<\n Record<string, MaybeRefSchemaObject>\n >((acc, [name, prop]) => {\n if (prop !== null && typeof prop === 'object') {\n acc[name] = prop as MaybeRefSchemaObject\n }\n return acc\n }, {})\n}\n\nconst getSchemaRequired = (value: ResolvedSchema | undefined): string[] => {\n const required = asObject(value)?.required\n if (!Array.isArray(required)) {\n return []\n }\n return required.filter((item): item is string => typeof item === 'string')\n}\n\nconst getSchemaItems = (\n value: ResolvedSchema | undefined,\n): MaybeRefSchemaObject | undefined => {\n const items = asObject(value)?.items\n return items !== null && typeof items === 'object'\n ? (items as MaybeRefSchemaObject)\n : undefined\n}\n\nconst getSchemaFormat = (\n value: ResolvedSchema | undefined,\n): string | undefined =>\n typeof asObject(value)?.format === 'string'\n ? (asObject(value)?.format as string)\n : undefined\n\nconst getSchemaEnum = (\n value: ResolvedSchema | undefined,\n): unknown[] | undefined => {\n const enumValues = asObject(value)?.enum\n return Array.isArray(enumValues) ? enumValues : undefined\n}\n\nconst getSchemaDefault = (value: ResolvedSchema | undefined): unknown =>\n asObject(value)?.default\n\nconst getSchemaDescription = (\n value: ResolvedSchema | undefined,\n): string | undefined =>\n typeof asObject(value)?.description === 'string'\n ? (asObject(value)?.description as string)\n : undefined\n\nconst getSchemaMinItems = (\n value: ResolvedSchema | undefined,\n): number | undefined =>\n typeof asObject(value)?.minItems === 'number'\n ? (asObject(value)?.minItems as number)\n : undefined\n\nconst getSchemaMaxItems = (\n value: ResolvedSchema | undefined,\n): number | undefined =>\n typeof asObject(value)?.maxItems === 'number'\n ? (asObject(value)?.maxItems as number)\n : undefined\n\nconst getSchemaUniqueItems = (\n value: ResolvedSchema | undefined,\n): boolean | undefined =>\n typeof asObject(value)?.uniqueItems === 'boolean'\n ? (asObject(value)?.uniqueItems as boolean)\n : undefined\n\nconst getResolvedSchemaType = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaType(resolveNestedSchema(value))\nconst getResolvedSchemaFormat = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaFormat(resolveNestedSchema(value))\nconst getResolvedSchemaEnum = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaEnum(resolveNestedSchema(value))\nconst getResolvedSchemaDefault = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaDefault(resolveNestedSchema(value))\nconst getResolvedSchemaDescription = (\n value: MaybeRefSchemaObject | undefined,\n) => getSchemaDescription(resolveNestedSchema(value))\nconst getResolvedSchemaProperties = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaProperties(resolveNestedSchema(value))\nconst getResolvedSchemaItems = (value: MaybeRefSchemaObject | undefined) =>\n getSchemaItems(resolveNestedSchema(value))\n\nconst formatSchemaType = (value: MaybeRefSchemaObject | undefined): string => {\n const schemaType = getResolvedSchemaType(value)\n return Array.isArray(schemaType)\n ? schemaType.join(' | ')\n : schemaType || 'object'\n}\n\nconst formatEnumValues = (value: unknown[] | undefined): string =>\n value?.map((entry: unknown) => JSON.stringify(entry)).join(', ') || ''\n\n// Sort properties to show required fields first, then optional, then metadata\nconst sortProperties = (\n properties: Record<string, MaybeRefSchemaObject>,\n required?: string[],\n) => {\n const sorted = Object.entries(properties).sort(([a], [b]) => {\n const aRequired = required?.includes(a)\n const bRequired = required?.includes(b)\n if (aRequired && !bRequired) return -1\n if (!aRequired && bRequired) return 1\n return a.localeCompare(b)\n })\n return Object.fromEntries(sorted)\n}\n</script>\n\n<template>\n <section v-if=\"depth >= MAX_DEPTH\">\n <p><em>[Circular Reference]</em></p>\n </section>\n <section v-else-if=\"resolvedSchema\">\n <!-- Composition keywords -->\n <template v-if=\"getSchemaArray(resolvedSchema, 'allOf')\">\n <section>\n <header>\n <strong>All of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in getSchemaArray(resolvedSchema, 'allOf')\"\n :key=\"index\">\n <Schema\n :schema=\"subSchema\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"getSchemaArray(resolvedSchema, 'anyOf')\">\n <section>\n <header>\n <strong>Any of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in getSchemaArray(resolvedSchema, 'anyOf')\"\n :key=\"index\">\n <Schema\n :schema=\"subSchema\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"getSchemaArray(resolvedSchema, 'oneOf')\">\n <section>\n <header>\n <strong>One of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in getSchemaArray(resolvedSchema, 'oneOf')\"\n :key=\"index\">\n <Schema\n :schema=\"subSchema\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"getSchemaNot(resolvedSchema)\">\n <section>\n <header>\n <strong>Not:</strong>\n </header>\n <section>\n <Schema\n :schema=\"getSchemaNot(resolvedSchema)!\"\n :depth=\"depth + 1\" />\n </section>\n </section>\n </template>\n\n <!-- Object type -->\n <template\n v-else-if=\"\n getSchemaType(resolvedSchema) === 'object' ||\n Object.keys(getSchemaProperties(resolvedSchema)).length\n \">\n <section>\n <ul>\n <template\n v-for=\"(propSchema, propName) in sortProperties(\n getSchemaProperties(resolvedSchema),\n getSchemaRequired(resolvedSchema),\n )\"\n :key=\"propName\">\n <li>\n <strong>\n <code>{{ propName }}</code>\n <span\n v-if=\"getSchemaRequired(resolvedSchema).includes(propName)\">\n (required)\n </span>\n </strong>\n <p>\n <code>\n {{ formatSchemaType(propSchema) }}\n </code>\n <template v-if=\"getResolvedSchemaFormat(propSchema)\">\n <span\n >, format:\n <code>{{ getResolvedSchemaFormat(propSchema) }}</code></span\n >\n </template>\n <template v-if=\"getResolvedSchemaEnum(propSchema)\">\n <span\n >, possible values:\n <code>{{\n formatEnumValues(getResolvedSchemaEnum(propSchema))\n }}</code>\n </span>\n </template>\n <template\n v-if=\"getResolvedSchemaDefault(propSchema) !== undefined\">\n <span\n >, default:\n <code>{{\n JSON.stringify(getResolvedSchemaDefault(propSchema))\n }}</code></span\n >\n </template>\n <template v-if=\"getResolvedSchemaDescription(propSchema)\">\n <span> — {{ getResolvedSchemaDescription(propSchema) }}</span>\n </template>\n </p>\n <Schema\n v-if=\"\n getResolvedSchemaType(propSchema) === 'object' ||\n Object.keys(getResolvedSchemaProperties(propSchema)).length\n \"\n :schema=\"propSchema\"\n :depth=\"depth + 1\" />\n <template\n v-if=\"\n getResolvedSchemaType(propSchema) === 'array' &&\n getResolvedSchemaItems(propSchema)\n \">\n <section>\n <header>\n <strong>Items:</strong>\n </header>\n <Schema\n :schema=\"getResolvedSchemaItems(propSchema)!\"\n :depth=\"depth + 1\" />\n </section>\n </template>\n </li>\n </template>\n </ul>\n </section>\n </template>\n\n <!-- Array type -->\n <template\n v-else-if=\"\n getSchemaType(resolvedSchema) === 'array' &&\n getSchemaItems(resolvedSchema)\n \">\n <section>\n <header>\n <strong>Array of:</strong>\n </header>\n <section>\n <Schema\n :schema=\"getSchemaItems(resolvedSchema)!\"\n :depth=\"depth + 1\" />\n </section>\n <ul\n v-if=\"\n getSchemaMinItems(resolvedSchema) !== undefined ||\n getSchemaMaxItems(resolvedSchema) !== undefined ||\n getSchemaUniqueItems(resolvedSchema)\n \">\n <li v-if=\"getSchemaMinItems(resolvedSchema) !== undefined\">\n Min items: <code>{{ getSchemaMinItems(resolvedSchema) }}</code>\n </li>\n <li v-if=\"getSchemaMaxItems(resolvedSchema) !== undefined\">\n Max items: <code>{{ getSchemaMaxItems(resolvedSchema) }}</code>\n </li>\n <li v-if=\"getSchemaUniqueItems(resolvedSchema)\">\n Unique items: <code>true</code>\n </li>\n </ul>\n </section>\n </template>\n\n <!-- Primitive types -->\n <template v-else>\n <section>\n <p>\n <code>{{ getSchemaType(resolvedSchema) }}</code>\n <template v-if=\"getSchemaFormat(resolvedSchema)\">\n <span\n >, format:\n <code>{{ getSchemaFormat(resolvedSchema) }}</code></span\n >\n </template>\n <template v-if=\"getSchemaEnum(resolvedSchema)\">\n <span\n >, possible values:\n <code>{{ formatEnumValues(getSchemaEnum(resolvedSchema)) }}</code>\n </span>\n </template>\n <template v-if=\"getSchemaDefault(resolvedSchema) !== undefined\">\n <span\n >, default:\n <code>{{\n JSON.stringify(getSchemaDefault(resolvedSchema))\n }}</code></span\n >\n </template>\n <template v-if=\"getSchemaDescription(resolvedSchema)\">\n <span> — {{ getSchemaDescription(resolvedSchema) }}</span>\n </template>\n </p>\n </section>\n </template>\n </section>\n</template>\n","<script setup lang=\"ts\">\nimport { json2xml } from '@scalar/helpers/file/json2xml'\nimport { computed } from 'vue'\n\nconst { xml = false, modelValue } = defineProps<{\n xml?: boolean\n modelValue: unknown\n}>()\n\nconst xmlContent = computed(() =>\n json2xml(modelValue as Record<string, unknown>),\n)\n</script>\n<template>\n <template v-if=\"xml\">\n <pre><code class=\"language-xml\">{{ xmlContent }}</code></pre>\n </template>\n <template v-else>\n <pre><code class=\"language-json\">{{ JSON.stringify(modelValue, null, 2) }}</code></pre>\n </template>\n</template>\n","<script setup lang=\"ts\">\nimport { json2xml } from '@scalar/helpers/file/json2xml'\nimport { computed } from 'vue'\n\nconst { xml = false, modelValue } = defineProps<{\n xml?: boolean\n modelValue: unknown\n}>()\n\nconst xmlContent = computed(() =>\n json2xml(modelValue as Record<string, unknown>),\n)\n</script>\n<template>\n <template v-if=\"xml\">\n <pre><code class=\"language-xml\">{{ xmlContent }}</code></pre>\n </template>\n <template v-else>\n <pre><code class=\"language-json\">{{ JSON.stringify(modelValue, null, 2) }}</code></pre>\n </template>\n</template>\n","<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { getExampleFromSchema } from '@scalar/workspace-store/request-example'\nimport type {\n OpenApiDocument,\n OperationObject,\n RequestBodyObject,\n ResponseObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\n// import { snippetz, type HarRequest } from '@scalar/snippetz'\n\nimport Schema from './Schema.vue'\nimport XmlOrJson from './XmlOrJson.vue'\n\ntype MarkdownDocument = Partial<OpenApiDocument> &\n Pick<OpenApiDocument, 'openapi' | 'info'>\ntype SchemaView = {\n description?: string\n title?: string\n type?: string | string[]\n}\ntype RequestBodyView = {\n content?: Record<string, { schema?: unknown }>\n}\ntype ResponseView = {\n description?: string\n content?: Record<string, { schema?: unknown }>\n}\n\ntype OperationEntry = {\n path: string\n method: string\n operation: OperationObject\n requestBody: RequestBodyView | null\n responses: Array<{\n statusCode: string\n response: ResponseView\n }>\n}\n\nconst { content } = defineProps<{\n content: MarkdownDocument\n}>()\n\n// const getRequestExample = (harRequest: Partial<HarRequest>) => {\n// const snippet = snippetz().print('shell', 'curl', {\n// httpVersion: 'HTTP/1.1',\n// headers: [],\n// queryString: [],\n// cookies: [],\n// headersSize: -1,\n// bodySize: -1,\n// method: 'get',\n// ...harRequest,\n// })\n\n// return snippet\n// }\n\nconst resolveRefAs = <TResolved extends object>(\n reference: unknown,\n): TResolved | null => {\n const resolved = getResolvedRef(reference as never)\n\n return resolved && typeof resolved === 'object'\n ? (resolved as TResolved)\n : null\n}\n\nconst resolveOperation = (operation: unknown): OperationObject | null =>\n resolveRefAs<OperationObject>(operation)\n\nconst resolveSchema = (schema: unknown): SchemaObject | null =>\n resolveRefAs<SchemaObject>(schema)\n\nconst resolveRequestBody = (body: unknown): RequestBodyObject | null =>\n resolveRefAs<RequestBodyObject>(body)\n\nconst resolveResponse = (response: unknown): ResponseObject | null =>\n resolveRefAs<ResponseObject>(response)\n\nconst toRequestBodyView = (body: unknown): RequestBodyView | null =>\n resolveRequestBody(body) as unknown as RequestBodyView | null\n\nconst toResponseView = (response: unknown): ResponseView | null =>\n resolveResponse(response) as unknown as ResponseView | null\n\nconst HTTP_METHODS = new Set([\n 'get',\n 'put',\n 'post',\n 'delete',\n 'options',\n 'head',\n 'patch',\n 'trace',\n])\n\nconst operations = computed<OperationEntry[]>(() => {\n const paths = content?.paths ?? {}\n\n return Object.entries(paths).flatMap(([path, pathItem]) => {\n if (!pathItem || typeof pathItem !== 'object') {\n return []\n }\n\n return Object.entries(pathItem).flatMap(([method, operation]) => {\n if (!HTTP_METHODS.has(method)) {\n return []\n }\n\n const resolvedOperation = resolveOperation(operation)\n\n if (!resolvedOperation) {\n return []\n }\n\n const requestBody = toRequestBodyView(resolvedOperation.requestBody)\n const responses = Object.entries(\n resolvedOperation.responses ?? {},\n ).flatMap(([statusCode, response]) => {\n const resolvedResponse = toResponseView(response)\n\n if (!resolvedResponse) {\n return []\n }\n\n return [{ statusCode, response: resolvedResponse }]\n })\n\n return [\n {\n path,\n method,\n operation: resolvedOperation,\n requestBody,\n responses,\n },\n ]\n })\n })\n})\n\nconst webhooks = computed(() => {\n const webhookItems = content?.webhooks ?? {}\n\n return Object.entries(webhookItems).flatMap(([name, pathItem]) => {\n if (!pathItem || typeof pathItem !== 'object') {\n return []\n }\n\n return Object.entries(pathItem).flatMap(([method, operation]) => {\n if (!HTTP_METHODS.has(method)) {\n return []\n }\n\n const resolvedOperation = resolveOperation(operation)\n\n if (!resolvedOperation) {\n return []\n }\n\n return [{ name, method, operation: resolvedOperation }]\n })\n })\n})\n\nconst componentSchemas = computed(() => {\n const schemas = content?.components?.schemas ?? {}\n\n return Object.entries(schemas).flatMap(([name, schema]) => {\n const resolvedSchema = resolveSchema(schema)\n\n if (!resolvedSchema) {\n return []\n }\n\n return [{ name, schema: resolvedSchema }]\n })\n})\n\nconst getSchemaView = (schema: SchemaObject): SchemaView =>\n schema as unknown as SchemaView\n</script>\n\n<template>\n <section>\n <header>\n <h1>{{ content?.info?.title }}</h1>\n <ul>\n <li>\n <strong>OpenAPI Version:</strong>&nbsp;<code>{{\n content?.openapi\n }}</code>\n </li>\n <li>\n <strong>API Version:</strong>&nbsp;<code>{{\n content?.info?.version\n }}</code>\n </li>\n </ul>\n </header>\n\n <ScalarMarkdown\n v-if=\"content?.info?.description\"\n :value=\"content?.info?.description\" />\n\n <section v-if=\"content?.servers?.length\">\n <h2>Servers</h2>\n <ul>\n <template\n v-for=\"server in content.servers\"\n :key=\"server.url\">\n <li>\n <strong>URL:</strong>&nbsp;<code>{{ server.url }}</code>\n <ul>\n <template v-if=\"server.description\">\n <li>\n <strong>Description:</strong>&nbsp;{{ server.description }}\n </li>\n </template>\n <template\n v-if=\"server.variables && Object.keys(server.variables).length\">\n <li>\n <strong>Variables:</strong>\n <ul>\n <template\n v-for=\"(variable, name) in server.variables\"\n :key=\"name\">\n <li>\n <code>{{ name }}</code> (default:\n <code>{{ variable.default }}</code\n >)<template v-if=\"variable.description\"\n >: {{ variable.description }}\n </template>\n </li>\n </template>\n </ul>\n </li>\n </template>\n </ul>\n </li>\n </template>\n </ul>\n </section>\n\n <section v-if=\"operations.length\">\n <h2>Operations</h2>\n\n <template\n v-for=\"entry in operations\"\n :key=\"`${entry.method}:${entry.path}`\">\n <section>\n <header>\n <h3>\n <template v-if=\"entry.operation.summary\">\n {{ entry.operation.summary }}\n </template>\n <template v-else>\n {{ entry.method.toString().toUpperCase() }} {{ entry.path }}\n </template>\n <template v-if=\"entry.operation['x-scalar-stability']\">\n ({{ entry.operation['x-scalar-stability'] }})\n </template>\n <template v-else-if=\"entry.operation.deprecated\">\n ⚠️ Deprecated\n </template>\n </h3>\n </header>\n\n <ul>\n <li>\n <strong>Method:</strong>&nbsp;<code>{{\n entry.method.toString().toUpperCase()\n }}</code>\n </li>\n <li>\n <strong>Path:</strong>&nbsp;<code>{{ entry.path }}</code>\n </li>\n <template v-if=\"entry.operation.tags\">\n <li>\n <strong>Tags:</strong>&nbsp;{{\n entry.operation.tags.join(', ')\n }}\n </li>\n </template>\n <template v-if=\"entry.operation['x-scalar-stability']\">\n <li>\n <strong>Stability:</strong>&nbsp;{{\n entry.operation['x-scalar-stability']\n }}\n </li>\n </template>\n </ul>\n\n <ScalarMarkdown :value=\"entry.operation.description\" />\n\n <!-- TODO: We need way more context to generate proper request examples -->\n <!-- <section>\n <h4>Request Example</h4>\n <pre><code>{{ getRequestExample({\n method: method.toString(),\n url: content.servers?.[0]?.url + path,\n }) }}</code></pre>\n </section> -->\n\n <template v-if=\"entry.requestBody?.content\">\n <section>\n <h4>Request Body</h4>\n <template\n v-for=\"(bodyContent, mediaType) in entry.requestBody.content\"\n :key=\"mediaType\">\n <h5>Content-Type: {{ mediaType }}</h5>\n <template v-if=\"resolveSchema(bodyContent.schema)\">\n <Schema :schema=\"resolveSchema(bodyContent.schema)!\" />\n <p><strong>Example:</strong></p>\n <XmlOrJson\n :modelValue=\"\n getExampleFromSchema(resolveSchema(bodyContent.schema)!, {\n xml: mediaType?.toString().includes('xml'),\n })\n \"\n :xml=\"mediaType?.toString().includes('xml')\" />\n </template>\n </template>\n </section>\n </template>\n\n <template v-if=\"entry.responses.length\">\n <section>\n <h4>Responses</h4>\n\n <template\n v-for=\"entryResponse in entry.responses\"\n :key=\"entryResponse.statusCode\">\n <section>\n <header>\n <h5>\n Status: {{ entryResponse.statusCode }}\n <template v-if=\"entryResponse.response.description\">\n {{ entryResponse.response.description }}\n </template>\n </h5>\n </header>\n <template v-if=\"entryResponse.response.content\">\n <template\n v-for=\"(responseContent, mediaType) in entryResponse\n .response.content\"\n :key=\"mediaType\">\n <section>\n <h6>Content-Type: {{ mediaType }}</h6>\n <template v-if=\"resolveSchema(responseContent.schema)\">\n <Schema\n :schema=\"resolveSchema(responseContent.schema)!\" />\n <p><strong>Example:</strong></p>\n <XmlOrJson\n :modelValue=\"\n getExampleFromSchema(\n resolveSchema(responseContent.schema)!,\n {\n xml: mediaType?.toString().includes('xml'),\n },\n )\n \"\n :xml=\"mediaType?.toString().includes('xml')\" />\n </template>\n </section>\n </template>\n </template>\n </section>\n </template>\n </section>\n </template>\n </section>\n </template>\n </section>\n\n <section v-if=\"webhooks.length\">\n <h2>Webhooks</h2>\n\n <template\n v-for=\"webhook in webhooks\"\n :key=\"`${webhook.name}:${webhook.method}`\">\n <section>\n <header>\n <h3>\n <template v-if=\"webhook.operation.summary\">\n {{ webhook.operation.summary }}\n </template>\n <template v-else>\n {{ webhook.name }}\n </template>\n <template v-if=\"webhook.operation['x-scalar-stability']\">\n <span>({{ webhook.operation['x-scalar-stability'] }})</span>\n </template>\n <template v-else-if=\"webhook.operation.deprecated\">\n <span>⚠️ Deprecated</span>\n </template>\n </h3>\n </header>\n\n <ul>\n <li>\n <strong>Method:</strong>\n <code>{{ webhook.method.toString().toUpperCase() }}</code>\n </li>\n <li>\n <strong>Path:</strong>\n <code>/webhooks/{{ webhook.name }}</code>\n </li>\n <template v-if=\"webhook.operation.tags\">\n <li>\n <strong>Tags:</strong>\n {{ webhook.operation.tags.join(', ') }}\n </li>\n </template>\n <template v-if=\"webhook.operation.deprecated\">\n <li><strong>Deprecated</strong></li>\n </template>\n </ul>\n\n <ScalarMarkdown :value=\"webhook.operation.description\" />\n\n <!-- TODO: We need way more context to generate proper request examples -->\n <!-- <section>\n <h4>Request Example</h4>\n <pre><code>{{ getRequestExample({\n method: method.toString(),\n url: content.servers?.[0]?.url + '/webhooks/' + name,\n }) }}</code></pre>\n </section> -->\n </section>\n </template>\n </section>\n\n <section v-if=\"componentSchemas.length\">\n <h2>Schemas</h2>\n <template\n v-for=\"entry in componentSchemas\"\n :key=\"entry.name\">\n <section>\n <header>\n <h3>{{ getSchemaView(entry.schema).title ?? entry.name }}</h3>\n </header>\n <ul>\n <li>\n <strong>Type:</strong>\n <code>{{ getSchemaView(entry.schema).type }}</code>\n </li>\n </ul>\n <template v-if=\"getSchemaView(entry.schema).description\">\n <ScalarMarkdown :value=\"getSchemaView(entry.schema).description\" />\n </template>\n <Schema\n v-if=\"getSchemaView(entry.schema).type === 'object'\"\n :schema=\"entry.schema\" />\n <p><strong>Example:</strong></p>\n <template v-if=\"getSchemaView(entry.schema).type === 'object'\">\n <XmlOrJson :modelValue=\"getExampleFromSchema(entry.schema)\" />\n </template>\n </section>\n </template>\n </section>\n </section>\n</template>\n","<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { getExampleFromSchema } from '@scalar/workspace-store/request-example'\nimport type {\n OpenApiDocument,\n OperationObject,\n RequestBodyObject,\n ResponseObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\n// import { snippetz, type HarRequest } from '@scalar/snippetz'\n\nimport Schema from './Schema.vue'\nimport XmlOrJson from './XmlOrJson.vue'\n\ntype MarkdownDocument = Partial<OpenApiDocument> &\n Pick<OpenApiDocument, 'openapi' | 'info'>\ntype SchemaView = {\n description?: string\n title?: string\n type?: string | string[]\n}\ntype RequestBodyView = {\n content?: Record<string, { schema?: unknown }>\n}\ntype ResponseView = {\n description?: string\n content?: Record<string, { schema?: unknown }>\n}\n\ntype OperationEntry = {\n path: string\n method: string\n operation: OperationObject\n requestBody: RequestBodyView | null\n responses: Array<{\n statusCode: string\n response: ResponseView\n }>\n}\n\nconst { content } = defineProps<{\n content: MarkdownDocument\n}>()\n\n// const getRequestExample = (harRequest: Partial<HarRequest>) => {\n// const snippet = snippetz().print('shell', 'curl', {\n// httpVersion: 'HTTP/1.1',\n// headers: [],\n// queryString: [],\n// cookies: [],\n// headersSize: -1,\n// bodySize: -1,\n// method: 'get',\n// ...harRequest,\n// })\n\n// return snippet\n// }\n\nconst resolveRefAs = <TResolved extends object>(\n reference: unknown,\n): TResolved | null => {\n const resolved = getResolvedRef(reference as never)\n\n return resolved && typeof resolved === 'object'\n ? (resolved as TResolved)\n : null\n}\n\nconst resolveOperation = (operation: unknown): OperationObject | null =>\n resolveRefAs<OperationObject>(operation)\n\nconst resolveSchema = (schema: unknown): SchemaObject | null =>\n resolveRefAs<SchemaObject>(schema)\n\nconst resolveRequestBody = (body: unknown): RequestBodyObject | null =>\n resolveRefAs<RequestBodyObject>(body)\n\nconst resolveResponse = (response: unknown): ResponseObject | null =>\n resolveRefAs<ResponseObject>(response)\n\nconst toRequestBodyView = (body: unknown): RequestBodyView | null =>\n resolveRequestBody(body) as unknown as RequestBodyView | null\n\nconst toResponseView = (response: unknown): ResponseView | null =>\n resolveResponse(response) as unknown as ResponseView | null\n\nconst HTTP_METHODS = new Set([\n 'get',\n 'put',\n 'post',\n 'delete',\n 'options',\n 'head',\n 'patch',\n 'trace',\n])\n\nconst operations = computed<OperationEntry[]>(() => {\n const paths = content?.paths ?? {}\n\n return Object.entries(paths).flatMap(([path, pathItem]) => {\n if (!pathItem || typeof pathItem !== 'object') {\n return []\n }\n\n return Object.entries(pathItem).flatMap(([method, operation]) => {\n if (!HTTP_METHODS.has(method)) {\n return []\n }\n\n const resolvedOperation = resolveOperation(operation)\n\n if (!resolvedOperation) {\n return []\n }\n\n const requestBody = toRequestBodyView(resolvedOperation.requestBody)\n const responses = Object.entries(\n resolvedOperation.responses ?? {},\n ).flatMap(([statusCode, response]) => {\n const resolvedResponse = toResponseView(response)\n\n if (!resolvedResponse) {\n return []\n }\n\n return [{ statusCode, response: resolvedResponse }]\n })\n\n return [\n {\n path,\n method,\n operation: resolvedOperation,\n requestBody,\n responses,\n },\n ]\n })\n })\n})\n\nconst webhooks = computed(() => {\n const webhookItems = content?.webhooks ?? {}\n\n return Object.entries(webhookItems).flatMap(([name, pathItem]) => {\n if (!pathItem || typeof pathItem !== 'object') {\n return []\n }\n\n return Object.entries(pathItem).flatMap(([method, operation]) => {\n if (!HTTP_METHODS.has(method)) {\n return []\n }\n\n const resolvedOperation = resolveOperation(operation)\n\n if (!resolvedOperation) {\n return []\n }\n\n return [{ name, method, operation: resolvedOperation }]\n })\n })\n})\n\nconst componentSchemas = computed(() => {\n const schemas = content?.components?.schemas ?? {}\n\n return Object.entries(schemas).flatMap(([name, schema]) => {\n const resolvedSchema = resolveSchema(schema)\n\n if (!resolvedSchema) {\n return []\n }\n\n return [{ name, schema: resolvedSchema }]\n })\n})\n\nconst getSchemaView = (schema: SchemaObject): SchemaView =>\n schema as unknown as SchemaView\n</script>\n\n<template>\n <section>\n <header>\n <h1>{{ content?.info?.title }}</h1>\n <ul>\n <li>\n <strong>OpenAPI Version:</strong>&nbsp;<code>{{\n content?.openapi\n }}</code>\n </li>\n <li>\n <strong>API Version:</strong>&nbsp;<code>{{\n content?.info?.version\n }}</code>\n </li>\n </ul>\n </header>\n\n <ScalarMarkdown\n v-if=\"content?.info?.description\"\n :value=\"content?.info?.description\" />\n\n <section v-if=\"content?.servers?.length\">\n <h2>Servers</h2>\n <ul>\n <template\n v-for=\"server in content.servers\"\n :key=\"server.url\">\n <li>\n <strong>URL:</strong>&nbsp;<code>{{ server.url }}</code>\n <ul>\n <template v-if=\"server.description\">\n <li>\n <strong>Description:</strong>&nbsp;{{ server.description }}\n </li>\n </template>\n <template\n v-if=\"server.variables && Object.keys(server.variables).length\">\n <li>\n <strong>Variables:</strong>\n <ul>\n <template\n v-for=\"(variable, name) in server.variables\"\n :key=\"name\">\n <li>\n <code>{{ name }}</code> (default:\n <code>{{ variable.default }}</code\n >)<template v-if=\"variable.description\"\n >: {{ variable.description }}\n </template>\n </li>\n </template>\n </ul>\n </li>\n </template>\n </ul>\n </li>\n </template>\n </ul>\n </section>\n\n <section v-if=\"operations.length\">\n <h2>Operations</h2>\n\n <template\n v-for=\"entry in operations\"\n :key=\"`${entry.method}:${entry.path}`\">\n <section>\n <header>\n <h3>\n <template v-if=\"entry.operation.summary\">\n {{ entry.operation.summary }}\n </template>\n <template v-else>\n {{ entry.method.toString().toUpperCase() }} {{ entry.path }}\n </template>\n <template v-if=\"entry.operation['x-scalar-stability']\">\n ({{ entry.operation['x-scalar-stability'] }})\n </template>\n <template v-else-if=\"entry.operation.deprecated\">\n ⚠️ Deprecated\n </template>\n </h3>\n </header>\n\n <ul>\n <li>\n <strong>Method:</strong>&nbsp;<code>{{\n entry.method.toString().toUpperCase()\n }}</code>\n </li>\n <li>\n <strong>Path:</strong>&nbsp;<code>{{ entry.path }}</code>\n </li>\n <template v-if=\"entry.operation.tags\">\n <li>\n <strong>Tags:</strong>&nbsp;{{\n entry.operation.tags.join(', ')\n }}\n </li>\n </template>\n <template v-if=\"entry.operation['x-scalar-stability']\">\n <li>\n <strong>Stability:</strong>&nbsp;{{\n entry.operation['x-scalar-stability']\n }}\n </li>\n </template>\n </ul>\n\n <ScalarMarkdown :value=\"entry.operation.description\" />\n\n <!-- TODO: We need way more context to generate proper request examples -->\n <!-- <section>\n <h4>Request Example</h4>\n <pre><code>{{ getRequestExample({\n method: method.toString(),\n url: content.servers?.[0]?.url + path,\n }) }}</code></pre>\n </section> -->\n\n <template v-if=\"entry.requestBody?.content\">\n <section>\n <h4>Request Body</h4>\n <template\n v-for=\"(bodyContent, mediaType) in entry.requestBody.content\"\n :key=\"mediaType\">\n <h5>Content-Type: {{ mediaType }}</h5>\n <template v-if=\"resolveSchema(bodyContent.schema)\">\n <Schema :schema=\"resolveSchema(bodyContent.schema)!\" />\n <p><strong>Example:</strong></p>\n <XmlOrJson\n :modelValue=\"\n getExampleFromSchema(resolveSchema(bodyContent.schema)!, {\n xml: mediaType?.toString().includes('xml'),\n })\n \"\n :xml=\"mediaType?.toString().includes('xml')\" />\n </template>\n </template>\n </section>\n </template>\n\n <template v-if=\"entry.responses.length\">\n <section>\n <h4>Responses</h4>\n\n <template\n v-for=\"entryResponse in entry.responses\"\n :key=\"entryResponse.statusCode\">\n <section>\n <header>\n <h5>\n Status: {{ entryResponse.statusCode }}\n <template v-if=\"entryResponse.response.description\">\n {{ entryResponse.response.description }}\n </template>\n </h5>\n </header>\n <template v-if=\"entryResponse.response.content\">\n <template\n v-for=\"(responseContent, mediaType) in entryResponse\n .response.content\"\n :key=\"mediaType\">\n <section>\n <h6>Content-Type: {{ mediaType }}</h6>\n <template v-if=\"resolveSchema(responseContent.schema)\">\n <Schema\n :schema=\"resolveSchema(responseContent.schema)!\" />\n <p><strong>Example:</strong></p>\n <XmlOrJson\n :modelValue=\"\n getExampleFromSchema(\n resolveSchema(responseContent.schema)!,\n {\n xml: mediaType?.toString().includes('xml'),\n },\n )\n \"\n :xml=\"mediaType?.toString().includes('xml')\" />\n </template>\n </section>\n </template>\n </template>\n </section>\n </template>\n </section>\n </template>\n </section>\n </template>\n </section>\n\n <section v-if=\"webhooks.length\">\n <h2>Webhooks</h2>\n\n <template\n v-for=\"webhook in webhooks\"\n :key=\"`${webhook.name}:${webhook.method}`\">\n <section>\n <header>\n <h3>\n <template v-if=\"webhook.operation.summary\">\n {{ webhook.operation.summary }}\n </template>\n <template v-else>\n {{ webhook.name }}\n </template>\n <template v-if=\"webhook.operation['x-scalar-stability']\">\n <span>({{ webhook.operation['x-scalar-stability'] }})</span>\n </template>\n <template v-else-if=\"webhook.operation.deprecated\">\n <span>⚠️ Deprecated</span>\n </template>\n </h3>\n </header>\n\n <ul>\n <li>\n <strong>Method:</strong>\n <code>{{ webhook.method.toString().toUpperCase() }}</code>\n </li>\n <li>\n <strong>Path:</strong>\n <code>/webhooks/{{ webhook.name }}</code>\n </li>\n <template v-if=\"webhook.operation.tags\">\n <li>\n <strong>Tags:</strong>\n {{ webhook.operation.tags.join(', ') }}\n </li>\n </template>\n <template v-if=\"webhook.operation.deprecated\">\n <li><strong>Deprecated</strong></li>\n </template>\n </ul>\n\n <ScalarMarkdown :value=\"webhook.operation.description\" />\n\n <!-- TODO: We need way more context to generate proper request examples -->\n <!-- <section>\n <h4>Request Example</h4>\n <pre><code>{{ getRequestExample({\n method: method.toString(),\n url: content.servers?.[0]?.url + '/webhooks/' + name,\n }) }}</code></pre>\n </section> -->\n </section>\n </template>\n </section>\n\n <section v-if=\"componentSchemas.length\">\n <h2>Schemas</h2>\n <template\n v-for=\"entry in componentSchemas\"\n :key=\"entry.name\">\n <section>\n <header>\n <h3>{{ getSchemaView(entry.schema).title ?? entry.name }}</h3>\n </header>\n <ul>\n <li>\n <strong>Type:</strong>\n <code>{{ getSchemaView(entry.schema).type }}</code>\n </li>\n </ul>\n <template v-if=\"getSchemaView(entry.schema).description\">\n <ScalarMarkdown :value=\"getSchemaView(entry.schema).description\" />\n </template>\n <Schema\n v-if=\"getSchemaView(entry.schema).type === 'object'\"\n :schema=\"entry.schema\" />\n <p><strong>Example:</strong></p>\n <template v-if=\"getSchemaView(entry.schema).type === 'object'\">\n <XmlOrJson :modelValue=\"getExampleFromSchema(entry.schema)\" />\n </template>\n </section>\n </template>\n </section>\n </section>\n</template>\n","import { isObject } from '@scalar/helpers/object/is-object'\nimport { readFiles } from '@scalar/json-magic/bundle/plugins/node'\nimport { normalize } from '@scalar/json-magic/helpers/normalize'\nimport type { OpenApiDocument, PathItemObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { createWorkspaceStore } from '@scalar/workspace-store/client'\nimport { minify } from 'html-minifier-terser'\nimport rehypeParse from 'rehype-parse'\nimport rehypeRemark from 'rehype-remark'\nimport rehypeSanitize from 'rehype-sanitize'\nimport remarkGfm from 'remark-gfm'\nimport remarkStringify from 'remark-stringify'\nimport { unified } from 'unified'\nimport { createSSRApp } from 'vue'\nimport { renderToString } from 'vue/server-renderer'\n\nimport MarkdownReference from './components/MarkdownReference.vue'\n\ntype AnyDocument = OpenApiDocument | Record<string, unknown> | string\ntype HttpMethodKeys = Exclude<keyof PathItemObject, '$ref' | 'summary' | 'description' | 'servers' | 'parameters'>\nexport type HttpMethod = Extract<HttpMethodKeys, string>\nexport type OperationSelector =\n | {\n path: string\n method: HttpMethod | Uppercase<HttpMethod>\n }\n | {\n operationId: string\n }\n | {\n pointer: string\n }\nexport type OpenApiRenderOptions = {\n operation?: OperationSelector\n}\ntype WorkspaceInput =\n | {\n document: Record<string, unknown>\n }\n | {\n url: string\n }\n | {\n path: string\n }\ntype OperationMatch = {\n path: string\n method: HttpMethod\n}\n\nconst HTTP_METHODS: HttpMethod[] = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace']\nconst HTTP_METHOD_SET = new Set<string>(HTTP_METHODS)\n\nconst isHttpUrl = (value: string): boolean => {\n try {\n const url = new URL(value)\n return url.protocol === 'http:' || url.protocol === 'https:'\n } catch {\n return false\n }\n}\n\nconst toWorkspaceInput = (input: AnyDocument): WorkspaceInput => {\n if (typeof input !== 'string') {\n return { document: input as Record<string, unknown> }\n }\n\n const normalized = normalize(input)\n\n if (isObject(normalized)) {\n return { document: normalized as Record<string, unknown> }\n }\n\n if (isHttpUrl(input)) {\n return { url: input }\n }\n\n return { path: input }\n}\n\nconst normalizeHttpMethod = (method: string): HttpMethod | null => {\n const normalized = method.toLowerCase()\n\n if (HTTP_METHOD_SET.has(normalized)) {\n return normalized as HttpMethod\n }\n\n return null\n}\n\nconst normalizeJsonPointer = (pointer: string): string => {\n if (pointer.startsWith('#/')) {\n return pointer.slice(1)\n }\n\n if (pointer.startsWith('/')) {\n return pointer\n }\n\n throw new Error(`Invalid JSON pointer \"${pointer}\". JSON pointers must start with \"#/\"`)\n}\n\nconst parseJsonPointer = (pointer: string): string[] =>\n normalizeJsonPointer(pointer)\n .slice(1)\n .split('/')\n .map((segment) => segment.replaceAll('~1', '/').replaceAll('~0', '~'))\n\nconst getOperationSelectorFromPointer = (pointer: string): Extract<OperationSelector, { path: string }> => {\n const segments = parseJsonPointer(pointer)\n\n if (segments.length !== 3 || segments[0] !== 'paths') {\n throw new Error(`JSON pointer \"${pointer}\" must target an operation object under \"/paths/{path}/{method}\"`)\n }\n\n const path = segments[1]\n const method = segments[2]\n\n if (!path || !method) {\n throw new Error(`JSON pointer \"${pointer}\" must target an operation object under \"/paths/{path}/{method}\"`)\n }\n\n return {\n path,\n method: method as HttpMethod,\n }\n}\n\nconst getPathEntries = (document: OpenApiDocument): Array<[string, PathItemObject]> => {\n const paths = document.paths\n\n if (!isObject(paths)) {\n return []\n }\n\n return Object.entries(paths).flatMap(([path, pathItem]) =>\n isObject(pathItem) ? [[path, pathItem as PathItemObject]] : [],\n )\n}\n\nconst filterPathItemToSingleOperation = (pathItem: PathItemObject, selectedMethod: HttpMethod): PathItemObject =>\n Object.fromEntries(\n Object.entries(pathItem).filter(([key]) => {\n const method = normalizeHttpMethod(key)\n return !method || method === selectedMethod\n }),\n )\n\nconst findOperationByPathAndMethod = (\n document: OpenApiDocument,\n selector: Extract<OperationSelector, { path: string }>,\n): OperationMatch => {\n const method = normalizeHttpMethod(selector.method)\n\n if (!method) {\n throw new Error(`Invalid HTTP method \"${selector.method}\". Supported methods: ${HTTP_METHODS.join(', ')}`)\n }\n\n const pathEntries = getPathEntries(document)\n const pathItem = pathEntries.find(([path]) => path === selector.path)?.[1]\n\n if (!pathItem || !(method in pathItem)) {\n throw new Error(`Operation not found for path \"${selector.path}\" and method \"${method.toUpperCase()}\"`)\n }\n\n return {\n path: selector.path,\n method,\n }\n}\n\nconst findOperationsByOperationId = (document: OpenApiDocument, operationId: string): OperationMatch[] =>\n getPathEntries(document).flatMap(([path, pathItem]) =>\n Object.entries(pathItem).flatMap(([methodKey, operation]) => {\n const method = normalizeHttpMethod(methodKey)\n\n if (!method || !isObject(operation)) {\n return []\n }\n\n const candidateOperationId =\n 'operationId' in operation && typeof operation.operationId === 'string' ? operation.operationId : undefined\n\n if (candidateOperationId !== operationId) {\n return []\n }\n\n return [{ path, method }]\n }),\n )\n\nconst resolveOperationMatch = (document: OpenApiDocument, selector: OperationSelector): OperationMatch => {\n if ('pointer' in selector) {\n return findOperationByPathAndMethod(document, getOperationSelectorFromPointer(selector.pointer))\n }\n\n if ('operationId' in selector) {\n const matches = findOperationsByOperationId(document, selector.operationId)\n\n if (!matches.length) {\n throw new Error(`Operation with operationId \"${selector.operationId}\" was not found`)\n }\n\n if (matches.length > 1) {\n const uniqueCandidates = matches.map(({ path, method }) => `\"${method.toUpperCase()} ${path}\"`)\n\n throw new Error(\n `Multiple operations found for operationId \"${selector.operationId}\". Use { path, method } instead. Matches: ${uniqueCandidates.join(', ')}`,\n )\n }\n\n return matches[0] as OperationMatch\n }\n\n return findOperationByPathAndMethod(document, selector)\n}\n\nconst filterDocumentByOperation = (document: OpenApiDocument, selector: OperationSelector): OpenApiDocument => {\n const match = resolveOperationMatch(document, selector)\n const pathItem = getPathEntries(document).find(([path]) => path === match.path)?.[1]\n\n if (!pathItem) {\n throw new Error(`Operation not found for path \"${match.path}\" and method \"${match.method.toUpperCase()}\"`)\n }\n\n return {\n ...document,\n paths: {\n [match.path]: filterPathItemToSingleOperation(pathItem, match.method),\n },\n }\n}\n\nexport async function createHtmlFromOpenApi(input: AnyDocument, options?: OpenApiRenderOptions) {\n const workspaceStore = createWorkspaceStore({\n fileLoader: readFiles(),\n })\n\n const name = 'openapi-to-markdown'\n const loaded = await workspaceStore.addDocument({\n name,\n ...toWorkspaceInput(input),\n })\n\n if (!loaded) {\n throw new Error('Failed to load OpenAPI document')\n }\n\n const content = workspaceStore.workspace.documents[name]\n\n if (!content) {\n throw new Error('OpenAPI document could not be resolved')\n }\n\n const renderedContent =\n options?.operation && isObject(content)\n ? filterDocumentByOperation(content as OpenApiDocument, options.operation)\n : content\n\n // Create and configure a server-side rendered Vue app\n const app = createSSRApp(MarkdownReference, {\n content: renderedContent,\n })\n\n // Get static HTML\n const html = await renderToString(app)\n\n // Clean the output\n return minify(html, {\n removeComments: true,\n removeEmptyElements: true,\n collapseWhitespace: true,\n continueOnParseError: true,\n noNewlinesBeforeTagClose: true,\n preserveLineBreaks: true,\n removeEmptyAttributes: true,\n decodeEntities: true,\n useShortDoctype: true,\n })\n}\n\nexport async function createMarkdownFromOpenApi(content: AnyDocument, options?: OpenApiRenderOptions) {\n return markdownFromHtml(await createHtmlFromOpenApi(content, options))\n}\n\nasync function markdownFromHtml(html: string): Promise<string> {\n const file = await unified()\n .use(rehypeParse, { fragment: true })\n .use(remarkGfm)\n .use(rehypeSanitize)\n .use(rehypeRemark)\n .use(remarkStringify, {\n bullet: '-',\n })\n .process(html)\n\n return String(file)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACIA,IAAM,YAAY;;;;;;;;;;EAWlB,MAAM,iBAAiB,QAAQ,OAAO,QAAA,OAAM;EAE5C,MAAM,uBACJ,UAC+B,QAAQ,OAAO,MAAK;EAErD,MAAM,YAAY,UAChB,UAAU,QAAQ,OAAO,UAAU,WAC9B,QACD,KAAA;EAEN,MAAM,iBACJ,UACkC;GAClC,MAAM,aAAa,SAAS,MAAM,EAAE;AACpC,OAAI,OAAO,eAAe,SACxB,QAAO;AAET,OACE,MAAM,QAAQ,WAAW,IACzB,WAAW,OAAO,UAAU,OAAO,UAAU,SAAQ,CAErD,QAAO;;EAKX,MAAM,kBACJ,OACA,QACuC;GACvC,MAAM,aAAa,SAAS,MAAM,GAAG;AACrC,OAAI,CAAC,MAAM,QAAQ,WAAW,CAC5B;AAEF,UAAO,WAAW,QACf,UACC,UAAU,QAAQ,OAAO,UAAU,SACvC;;EAGF,MAAM,gBACJ,UACqC;GACrC,MAAM,YAAY,SAAS,MAAM,EAAE;AACnC,UAAO,cAAc,QAAQ,OAAO,cAAc,WAC7C,YACD,KAAA;;EAGN,MAAM,uBACJ,UACyC;GACzC,M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GlB;EAClB,gBAAgB;EAChB,qBAAqB;EACrB,oBAAoB;EACpB,sBAAsB;EACtB,0BAA0B;EAC1B,oBAAoB;EACpB,uBAAuB;EACvB,gBAAgB;EAChB,iBAAiB;EAClB,CAAC;;AAGJ,eAAsB,0BAA0B,SAAsB,SAAgC;AACpG,QAAO,iBAAiB,MAAM,sBAAsB,SAAS,QAAQ,CAAC;;AAGxE,eAAe,iBAAiB,MAA+B;CAC7D,MAAM,OAAO,MAAM,SAAS,CACzB,IAAI,aAAa,EAAE,UAAU,MAAM,CAAC,CACpC,IAAI,UAAU,CACd,IAAI,eAAe,CACnB,IAAI,aAAa,CACjB,IAAI,iBAAiB,EACpB,QAAQ,KACT,CAAC,CACD,QAAQ,KAAK;AAEhB,QAAO,OAAO,KAAK"}
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "llm",
17
17
  "swagger"
18
18
  ],
19
- "version": "0.5.3",
19
+ "version": "0.5.5",
20
20
  "engines": {
21
21
  "node": ">=22"
22
22
  },
@@ -53,11 +53,10 @@
53
53
  "remark-stringify": "^11.0.0",
54
54
  "unified": "^11.0.5",
55
55
  "vue": "^3.5.30",
56
- "@scalar/components": "0.21.4",
57
- "@scalar/json-magic": "0.12.5",
58
- "@scalar/helpers": "0.4.3",
59
- "@scalar/oas-utils": "0.11.1",
60
- "@scalar/workspace-store": "0.45.0"
56
+ "@scalar/components": "0.22.1",
57
+ "@scalar/helpers": "0.5.1",
58
+ "@scalar/json-magic": "0.12.7",
59
+ "@scalar/workspace-store": "0.46.1"
61
60
  },
62
61
  "devDependencies": {
63
62
  "@hono/node-server": "^1.19.10",
@@ -73,7 +72,7 @@
73
72
  "scripts": {
74
73
  "build": "vite build && vue-tsc -p tsconfig.build.json",
75
74
  "dev": "tsx watch playground/index.ts",
76
- "test": "vitest",
75
+ "test": "vitest --run",
77
76
  "types:check": "vue-tsc --noEmit"
78
77
  }
79
78
  }