@scalar/openapi-to-markdown 0.4.16 → 0.5.1

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,18 @@
1
1
  # @scalar/openapi-to-markdown
2
2
 
3
+ ## 0.5.1
4
+
5
+ ## 0.5.0
6
+
7
+ ### Minor Changes
8
+
9
+ - [#8710](https://github.com/scalar/scalar/pull/8710): feat(openapi-to-markdown): support rendering single operations by selector (operationId, path+method, and JSON pointer), including full `#/...` pointer support.
10
+ - [#8638](https://github.com/scalar/scalar/pull/8638): refactor openapi-to-markdown to use workspace-store and json-magic bundling instead of openapi-parser, while preserving the existing public API and adding file/url reference bundling support.
11
+
12
+ ### Patch Changes
13
+
14
+ - [#8710](https://github.com/scalar/scalar/pull/8710): Reject unsupported `connect` operation selectors so markdown generation fails with a clear error instead of silently producing an empty operations section.
15
+
3
16
  ## 0.4.16
4
17
 
5
18
  ## 0.4.15
package/README.md CHANGED
@@ -31,6 +31,28 @@ const content = {
31
31
 
32
32
  // Generate Markdown from an OpenAPI document
33
33
  const markdown = await createMarkdownFromOpenApi(content)
34
+
35
+ // Generate Markdown for a single operation
36
+ const operationMarkdown = await createMarkdownFromOpenApi(content, {
37
+ operation: {
38
+ operationId: 'getUser',
39
+ },
40
+ })
41
+
42
+ // You can also select by path + method
43
+ const operationMarkdownByPath = await createMarkdownFromOpenApi(content, {
44
+ operation: {
45
+ path: '/users/{id}',
46
+ method: 'get',
47
+ },
48
+ })
49
+
50
+ // Or use a full JSON pointer to the operation object
51
+ const operationMarkdownByPointer = await createMarkdownFromOpenApi(content, {
52
+ operation: {
53
+ pointer: '#/paths/~1users~1{id}/get',
54
+ },
55
+ })
34
56
  ```
35
57
 
36
58
  ### With Hono
@@ -1,6 +1,7 @@
1
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
1
+ import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ type MarkdownDocument = Partial<OpenApiDocument> & Pick<OpenApiDocument, 'openapi' | 'info'>;
2
3
  type __VLS_Props = {
3
- content: OpenAPIV3_1.Document;
4
+ content: MarkdownDocument;
4
5
  };
5
6
  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>;
6
7
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/MarkdownReference.vue"],"names":[],"mappings":"AA8TA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAOxD,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAA;CAC9B,CAAC;AA0cF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"MarkdownReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/MarkdownReference.vue"],"names":[],"mappings":"AA2dA,OAAO,KAAK,EACV,eAAe,EAKhB,MAAM,8DAA8D,CAAA;AAQrE,KAAK,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,GAC9C,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,MAAM,CAAC,CAAA;AAyB3C,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAC;AA0kBF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,6 +1,6 @@
1
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
1
+ import type { MaybeRefSchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema';
2
2
  type __VLS_Props = {
3
- schema: OpenAPIV3_1.SchemaObject;
3
+ schema: MaybeRefSchemaObject;
4
4
  };
5
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>;
6
6
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../src/components/Schema.vue"],"names":[],"mappings":"AA8MA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,WAAW,CAAC,YAAY,CAAA;CACjC,CAAC;AA+TF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../src/components/Schema.vue"],"names":[],"mappings":"AA8XA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAA;AAE9F,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,oBAAoB,CAAA;CAC7B,CAAC;AA4fF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
1
+ import type { MaybeRefSchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema';
2
2
  type __VLS_Props = {
3
3
  xml?: boolean;
4
- modelValue: OpenAPIV3_1.SchemaObject;
4
+ modelValue: MaybeRefSchemaObject;
5
5
  };
6
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
7
  xml: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"XmlOrJson.vue.d.ts","sourceRoot":"","sources":["../../src/components/XmlOrJson.vue"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,KAAK,WAAW,GAAG;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,UAAU,EAAE,WAAW,CAAC,YAAY,CAAA;CACrC,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":"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,6 +1,19 @@
1
- import type { OpenAPI } from '@scalar/openapi-types';
2
- type AnyDocument = OpenAPI.Document | Record<string, unknown> | string;
3
- export declare function createHtmlFromOpenApi(input: AnyDocument): Promise<string>;
4
- export declare function createMarkdownFromOpenApi(content: AnyDocument): Promise<string>;
1
+ import type { OpenApiDocument, PathItemObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ type AnyDocument = OpenApiDocument | Record<string, unknown> | string;
3
+ type HttpMethodKeys = Exclude<keyof PathItemObject, '$ref' | 'summary' | 'description' | 'servers' | 'parameters'>;
4
+ export type HttpMethod = Extract<HttpMethodKeys, string>;
5
+ export type OperationSelector = {
6
+ path: string;
7
+ method: HttpMethod | Uppercase<HttpMethod>;
8
+ } | {
9
+ operationId: string;
10
+ } | {
11
+ pointer: string;
12
+ };
13
+ export type OpenApiRenderOptions = {
14
+ operation?: OperationSelector;
15
+ };
16
+ export declare function createHtmlFromOpenApi(input: AnyDocument, options?: OpenApiRenderOptions): Promise<string>;
17
+ export declare function createMarkdownFromOpenApi(content: AnyDocument, options?: OpenApiRenderOptions): Promise<string>;
5
18
  export {};
6
19
  //# sourceMappingURL=create-markdown-from-openapi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-markdown-from-openapi.d.ts","sourceRoot":"","sources":["../src/create-markdown-from-openapi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAepD,KAAK,WAAW,GAAG,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAA;AAEtE,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,WAAW,mBAyB7D;AAED,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,WAAW,mBAEnE"}
1
+ {"version":3,"file":"create-markdown-from-openapi.d.ts","sourceRoot":"","sources":["../src/create-markdown-from-openapi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAA;AAcnH,KAAK,WAAW,GAAG,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAA;AACrE,KAAK,cAAc,GAAG,OAAO,CAAC,MAAM,cAAc,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC,CAAA;AAClH,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACxD,MAAM,MAAM,iBAAiB,GACzB;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,CAAA;CAC3C,GACD;IACE,WAAW,EAAE,MAAM,CAAA;CACpB,GACD;IACE,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AACL,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,CAAC,EAAE,iBAAiB,CAAA;CAC9B,CAAA;AAuMD,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,oBAAoB,mBA8C7F;AAED,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,oBAAoB,mBAEnG"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export { createHtmlFromOpenApi, createMarkdownFromOpenApi } from './create-markdown-from-openapi';
1
+ export { createHtmlFromOpenApi, createMarkdownFromOpenApi, } from './create-markdown-from-openapi';
2
+ export type { HttpMethod, OpenApiRenderOptions, OperationSelector, } from './create-markdown-from-openapi';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,gCAAgC,CAAA;AACvC,YAAY,EACV,UAAU,EACV,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,gCAAgC,CAAA"}
package/dist/index.js CHANGED
@@ -1,5 +1,7 @@
1
- import { dereference, normalize } from "@scalar/openapi-parser";
2
- import { upgrade } from "@scalar/openapi-upgrader";
1
+ import { isObject } from "@scalar/helpers/object/is-object";
2
+ import { readFiles } from "@scalar/json-magic/bundle/plugins/node";
3
+ import { normalize } from "@scalar/json-magic/helpers/normalize";
4
+ import { createWorkspaceStore } from "@scalar/workspace-store/client";
3
5
  import { minify } from "html-minifier-terser";
4
6
  import rehypeParse from "rehype-parse";
5
7
  import rehypeRemark from "rehype-remark";
@@ -7,10 +9,12 @@ import rehypeSanitize from "rehype-sanitize";
7
9
  import remarkGfm from "remark-gfm";
8
10
  import remarkStringify from "remark-stringify";
9
11
  import { unified } from "unified";
10
- import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSSRApp, createTextVNode, createVNode, defineComponent, openBlock, renderList, resolveComponent, toDisplayString, unref } from "vue";
12
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSSRApp, createTextVNode, createVNode, defineComponent, openBlock, renderList, resolveComponent, toDisplayString, unref } from "vue";
11
13
  import { renderToString } from "vue/server-renderer";
12
14
  import { ScalarMarkdown } from "@scalar/components";
13
15
  import { getExampleFromSchema } from "@scalar/oas-utils/spec-getters";
16
+ import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
17
+ import { resolve } from "@scalar/workspace-store/resolve";
14
18
  import { json2xml } from "@scalar/helpers/file/json2xml";
15
19
  //#region src/components/Schema.vue?vue&type=script&setup=true&lang.ts
16
20
  var _hoisted_1$2 = { key: 0 };
@@ -39,8 +43,64 @@ var _hoisted_22 = { key: 3 };
39
43
  //#region src/components/Schema.vue
40
44
  var Schema_default = /* @__PURE__ */ defineComponent({
41
45
  __name: "Schema",
42
- props: { schema: { type: [Object, Boolean] } },
46
+ props: { schema: {} },
43
47
  setup(__props) {
48
+ const resolvedSchema = resolve.schema(__props.schema);
49
+ const resolveNestedSchema = (value) => resolve.schema(value);
50
+ const asObject = (value) => value !== null && typeof value === "object" ? value : void 0;
51
+ const getSchemaType = (value) => {
52
+ const schemaType = asObject(value)?.type;
53
+ if (typeof schemaType === "string") return schemaType;
54
+ if (Array.isArray(schemaType) && schemaType.every((entry) => typeof entry === "string")) return schemaType;
55
+ };
56
+ const getSchemaArray = (value, key) => {
57
+ const collection = asObject(value)?.[key];
58
+ if (!Array.isArray(collection)) return;
59
+ return collection.filter((entry) => entry !== null && typeof entry === "object");
60
+ };
61
+ const getSchemaNot = (value) => {
62
+ const notSchema = asObject(value)?.not;
63
+ return notSchema !== null && typeof notSchema === "object" ? notSchema : void 0;
64
+ };
65
+ const getSchemaProperties = (value) => {
66
+ const properties = asObject(value)?.properties;
67
+ if (!properties || typeof properties !== "object") return {};
68
+ return Object.entries(properties).reduce((acc, [name, prop]) => {
69
+ if (prop !== null && typeof prop === "object") acc[name] = prop;
70
+ return acc;
71
+ }, {});
72
+ };
73
+ const getSchemaRequired = (value) => {
74
+ const required = asObject(value)?.required;
75
+ if (!Array.isArray(required)) return [];
76
+ return required.filter((item) => typeof item === "string");
77
+ };
78
+ const getSchemaItems = (value) => {
79
+ const items = asObject(value)?.items;
80
+ return items !== null && typeof items === "object" ? items : void 0;
81
+ };
82
+ const getSchemaFormat = (value) => typeof asObject(value)?.format === "string" ? asObject(value)?.format : void 0;
83
+ const getSchemaEnum = (value) => {
84
+ const enumValues = asObject(value)?.enum;
85
+ return Array.isArray(enumValues) ? enumValues : void 0;
86
+ };
87
+ const getSchemaDefault = (value) => asObject(value)?.default;
88
+ const getSchemaDescription = (value) => typeof asObject(value)?.description === "string" ? asObject(value)?.description : void 0;
89
+ const getSchemaMinItems = (value) => typeof asObject(value)?.minItems === "number" ? asObject(value)?.minItems : void 0;
90
+ const getSchemaMaxItems = (value) => typeof asObject(value)?.maxItems === "number" ? asObject(value)?.maxItems : void 0;
91
+ const getSchemaUniqueItems = (value) => typeof asObject(value)?.uniqueItems === "boolean" ? asObject(value)?.uniqueItems : void 0;
92
+ const getResolvedSchemaType = (value) => getSchemaType(resolveNestedSchema(value));
93
+ const getResolvedSchemaFormat = (value) => getSchemaFormat(resolveNestedSchema(value));
94
+ const getResolvedSchemaEnum = (value) => getSchemaEnum(resolveNestedSchema(value));
95
+ const getResolvedSchemaDefault = (value) => getSchemaDefault(resolveNestedSchema(value));
96
+ const getResolvedSchemaDescription = (value) => getSchemaDescription(resolveNestedSchema(value));
97
+ const getResolvedSchemaProperties = (value) => getSchemaProperties(resolveNestedSchema(value));
98
+ const getResolvedSchemaItems = (value) => getSchemaItems(resolveNestedSchema(value));
99
+ const formatSchemaType = (value) => {
100
+ const schemaType = getResolvedSchemaType(value);
101
+ return Array.isArray(schemaType) ? schemaType.join(" | ") : schemaType || "object";
102
+ };
103
+ const formatEnumValues = (value) => value?.map((entry) => JSON.stringify(entry)).join(", ") || "";
44
104
  const sortProperties = (properties, required) => {
45
105
  const sorted = Object.entries(properties).sort(([a], [b]) => {
46
106
  const aRequired = required?.includes(a);
@@ -53,42 +113,42 @@ var Schema_default = /* @__PURE__ */ defineComponent({
53
113
  };
54
114
  return (_ctx, _cache) => {
55
115
  const _component_Schema = resolveComponent("Schema", true);
56
- return __props.schema ? (openBlock(), createElementBlock("section", _hoisted_1$2, [__props.schema.allOf ? (openBlock(), createElementBlock("section", _hoisted_2$2, [_cache[0] || (_cache[0] = createElementVNode("header", null, [createElementVNode("strong", null, "All of:")], -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.schema.allOf, (subSchema, index) => {
116
+ return unref(resolvedSchema) ? (openBlock(), createElementBlock("section", _hoisted_1$2, [getSchemaArray(unref(resolvedSchema), "allOf") ? (openBlock(), createElementBlock("section", _hoisted_2$2, [_cache[0] || (_cache[0] = createElementVNode("header", null, [createElementVNode("strong", null, "All of:")], -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(getSchemaArray(unref(resolvedSchema), "allOf"), (subSchema, index) => {
57
117
  return openBlock(), createElementBlock("section", { key: index }, [createVNode(_component_Schema, { schema: subSchema }, null, 8, ["schema"])]);
58
- }), 128))])) : __props.schema.anyOf ? (openBlock(), createElementBlock("section", _hoisted_3$2, [_cache[1] || (_cache[1] = createElementVNode("header", null, [createElementVNode("strong", null, "Any of:")], -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.schema.anyOf, (subSchema, index) => {
118
+ }), 128))])) : getSchemaArray(unref(resolvedSchema), "anyOf") ? (openBlock(), createElementBlock("section", _hoisted_3$2, [_cache[1] || (_cache[1] = createElementVNode("header", null, [createElementVNode("strong", null, "Any of:")], -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(getSchemaArray(unref(resolvedSchema), "anyOf"), (subSchema, index) => {
59
119
  return openBlock(), createElementBlock("section", { key: index }, [createVNode(_component_Schema, { schema: subSchema }, null, 8, ["schema"])]);
60
- }), 128))])) : __props.schema.oneOf ? (openBlock(), createElementBlock("section", _hoisted_4$2, [_cache[2] || (_cache[2] = createElementVNode("header", null, [createElementVNode("strong", null, "One of:")], -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.schema.oneOf, (subSchema, index) => {
120
+ }), 128))])) : getSchemaArray(unref(resolvedSchema), "oneOf") ? (openBlock(), createElementBlock("section", _hoisted_4$2, [_cache[2] || (_cache[2] = createElementVNode("header", null, [createElementVNode("strong", null, "One of:")], -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(getSchemaArray(unref(resolvedSchema), "oneOf"), (subSchema, index) => {
61
121
  return openBlock(), createElementBlock("section", { key: index }, [createVNode(_component_Schema, { schema: subSchema }, null, 8, ["schema"])]);
62
- }), 128))])) : __props.schema.not ? (openBlock(), createElementBlock("section", _hoisted_5$1, [_cache[3] || (_cache[3] = createElementVNode("header", null, [createElementVNode("strong", null, "Not:")], -1)), createElementVNode("section", null, [createVNode(_component_Schema, { schema: __props.schema.not }, null, 8, ["schema"])])])) : __props.schema.type === "object" || __props.schema.properties ? (openBlock(), createElementBlock("section", _hoisted_6$1, [createElementVNode("ul", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(sortProperties(__props.schema.properties || {}, __props.schema.required), (propSchema, propName) => {
122
+ }), 128))])) : getSchemaNot(unref(resolvedSchema)) ? (openBlock(), createElementBlock("section", _hoisted_5$1, [_cache[3] || (_cache[3] = createElementVNode("header", null, [createElementVNode("strong", null, "Not:")], -1)), createElementVNode("section", null, [createVNode(_component_Schema, { schema: getSchemaNot(unref(resolvedSchema)) }, null, 8, ["schema"])])])) : getSchemaType(unref(resolvedSchema)) === "object" || Object.keys(getSchemaProperties(unref(resolvedSchema))).length ? (openBlock(), createElementBlock("section", _hoisted_6$1, [createElementVNode("ul", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(sortProperties(getSchemaProperties(unref(resolvedSchema)), getSchemaRequired(unref(resolvedSchema))), (propSchema, propName) => {
63
123
  return openBlock(), createElementBlock("li", { key: propName }, [
64
- createElementVNode("strong", null, [createElementVNode("code", null, toDisplayString(propName), 1), __props.schema.required?.includes(propName) ? (openBlock(), createElementBlock("span", _hoisted_7$1, " (required) ")) : createCommentVNode("", true)]),
124
+ createElementVNode("strong", null, [createElementVNode("code", null, toDisplayString(propName), 1), getSchemaRequired(unref(resolvedSchema)).includes(propName) ? (openBlock(), createElementBlock("span", _hoisted_7$1, " (required) ")) : createCommentVNode("", true)]),
65
125
  createElementVNode("p", null, [
66
- createElementVNode("code", null, toDisplayString(Array.isArray(propSchema.type) ? propSchema.type.join(" | ") : propSchema.type || "object"), 1),
67
- propSchema.format ? (openBlock(), createElementBlock("span", _hoisted_8$1, [_cache[4] || (_cache[4] = createTextVNode(", format: ", -1)), createElementVNode("code", null, toDisplayString(propSchema.format), 1)])) : createCommentVNode("", true),
68
- propSchema.enum ? (openBlock(), createElementBlock("span", _hoisted_9$1, [_cache[5] || (_cache[5] = createTextVNode(", possible values: ", -1)), createElementVNode("code", null, toDisplayString(propSchema.enum.map((e) => JSON.stringify(e)).join(", ")), 1)])) : createCommentVNode("", true),
69
- propSchema.default !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_10$1, [_cache[6] || (_cache[6] = createTextVNode(", default: ", -1)), createElementVNode("code", null, toDisplayString(JSON.stringify(propSchema.default)), 1)])) : createCommentVNode("", true),
70
- propSchema.description ? (openBlock(), createElementBlock("span", _hoisted_11$1, " — " + toDisplayString(propSchema.description), 1)) : createCommentVNode("", true)
126
+ createElementVNode("code", null, toDisplayString(formatSchemaType(propSchema)), 1),
127
+ getResolvedSchemaFormat(propSchema) ? (openBlock(), createElementBlock("span", _hoisted_8$1, [_cache[4] || (_cache[4] = createTextVNode(", format: ", -1)), createElementVNode("code", null, toDisplayString(getResolvedSchemaFormat(propSchema)), 1)])) : createCommentVNode("", true),
128
+ getResolvedSchemaEnum(propSchema) ? (openBlock(), createElementBlock("span", _hoisted_9$1, [_cache[5] || (_cache[5] = createTextVNode(", possible values: ", -1)), createElementVNode("code", null, toDisplayString(formatEnumValues(getResolvedSchemaEnum(propSchema))), 1)])) : createCommentVNode("", true),
129
+ getResolvedSchemaDefault(propSchema) !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_10$1, [_cache[6] || (_cache[6] = createTextVNode(", default: ", -1)), createElementVNode("code", null, toDisplayString(JSON.stringify(getResolvedSchemaDefault(propSchema))), 1)])) : createCommentVNode("", true),
130
+ getResolvedSchemaDescription(propSchema) ? (openBlock(), createElementBlock("span", _hoisted_11$1, " — " + toDisplayString(getResolvedSchemaDescription(propSchema)), 1)) : createCommentVNode("", true)
71
131
  ]),
72
- propSchema.type === "object" || propSchema.properties ? (openBlock(), createBlock(_component_Schema, {
132
+ getResolvedSchemaType(propSchema) === "object" || Object.keys(getResolvedSchemaProperties(propSchema)).length ? (openBlock(), createBlock(_component_Schema, {
73
133
  key: 0,
74
134
  schema: propSchema
75
135
  }, null, 8, ["schema"])) : createCommentVNode("", true),
76
- propSchema.type === "array" && propSchema.items ? (openBlock(), createElementBlock("section", _hoisted_12$1, [_cache[7] || (_cache[7] = createElementVNode("header", null, [createElementVNode("strong", null, "Items:")], -1)), createVNode(_component_Schema, { schema: propSchema.items }, null, 8, ["schema"])])) : createCommentVNode("", true)
136
+ getResolvedSchemaType(propSchema) === "array" && getResolvedSchemaItems(propSchema) ? (openBlock(), createElementBlock("section", _hoisted_12$1, [_cache[7] || (_cache[7] = createElementVNode("header", null, [createElementVNode("strong", null, "Items:")], -1)), createVNode(_component_Schema, { schema: getResolvedSchemaItems(propSchema) }, null, 8, ["schema"])])) : createCommentVNode("", true)
77
137
  ]);
78
- }), 128))])])) : __props.schema.type === "array" && __props.schema.items ? (openBlock(), createElementBlock("section", _hoisted_13$1, [
138
+ }), 128))])])) : getSchemaType(unref(resolvedSchema)) === "array" && getSchemaItems(unref(resolvedSchema)) ? (openBlock(), createElementBlock("section", _hoisted_13$1, [
79
139
  _cache[11] || (_cache[11] = createElementVNode("header", null, [createElementVNode("strong", null, "Array of:")], -1)),
80
- createElementVNode("section", null, [createVNode(_component_Schema, { schema: __props.schema.items }, null, 8, ["schema"])]),
81
- __props.schema.minItems !== void 0 || __props.schema.maxItems !== void 0 || __props.schema.uniqueItems ? (openBlock(), createElementBlock("ul", _hoisted_14$1, [
82
- __props.schema.minItems !== void 0 ? (openBlock(), createElementBlock("li", _hoisted_15, [_cache[8] || (_cache[8] = createTextVNode(" Min items: ", -1)), createElementVNode("code", null, toDisplayString(__props.schema.minItems), 1)])) : createCommentVNode("", true),
83
- __props.schema.maxItems !== void 0 ? (openBlock(), createElementBlock("li", _hoisted_16, [_cache[9] || (_cache[9] = createTextVNode(" Max items: ", -1)), createElementVNode("code", null, toDisplayString(__props.schema.maxItems), 1)])) : createCommentVNode("", true),
84
- __props.schema.uniqueItems ? (openBlock(), createElementBlock("li", _hoisted_17, [..._cache[10] || (_cache[10] = [createTextVNode("Unique items: ", -1), createElementVNode("code", null, "true", -1)])])) : createCommentVNode("", true)
140
+ createElementVNode("section", null, [createVNode(_component_Schema, { schema: getSchemaItems(unref(resolvedSchema)) }, null, 8, ["schema"])]),
141
+ getSchemaMinItems(unref(resolvedSchema)) !== void 0 || getSchemaMaxItems(unref(resolvedSchema)) !== void 0 || getSchemaUniqueItems(unref(resolvedSchema)) ? (openBlock(), createElementBlock("ul", _hoisted_14$1, [
142
+ getSchemaMinItems(unref(resolvedSchema)) !== void 0 ? (openBlock(), createElementBlock("li", _hoisted_15, [_cache[8] || (_cache[8] = createTextVNode(" Min items: ", -1)), createElementVNode("code", null, toDisplayString(getSchemaMinItems(unref(resolvedSchema))), 1)])) : createCommentVNode("", true),
143
+ getSchemaMaxItems(unref(resolvedSchema)) !== void 0 ? (openBlock(), createElementBlock("li", _hoisted_16, [_cache[9] || (_cache[9] = createTextVNode(" Max items: ", -1)), createElementVNode("code", null, toDisplayString(getSchemaMaxItems(unref(resolvedSchema))), 1)])) : createCommentVNode("", true),
144
+ getSchemaUniqueItems(unref(resolvedSchema)) ? (openBlock(), createElementBlock("li", _hoisted_17, [..._cache[10] || (_cache[10] = [createTextVNode(" Unique items: ", -1), createElementVNode("code", null, "true", -1)])])) : createCommentVNode("", true)
85
145
  ])) : createCommentVNode("", true)
86
146
  ])) : (openBlock(), createElementBlock("section", _hoisted_18, [createElementVNode("p", null, [
87
- createElementVNode("code", null, toDisplayString(__props.schema.type), 1),
88
- __props.schema.format ? (openBlock(), createElementBlock("span", _hoisted_19, [_cache[12] || (_cache[12] = createTextVNode(", format: ", -1)), createElementVNode("code", null, toDisplayString(__props.schema.format), 1)])) : createCommentVNode("", true),
89
- __props.schema.enum ? (openBlock(), createElementBlock("span", _hoisted_20, [_cache[13] || (_cache[13] = createTextVNode(", possible values: ", -1)), createElementVNode("code", null, toDisplayString(__props.schema.enum.map((e) => JSON.stringify(e)).join(", ")), 1)])) : createCommentVNode("", true),
90
- __props.schema.default !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_21, [_cache[14] || (_cache[14] = createTextVNode(", default: ", -1)), createElementVNode("code", null, toDisplayString(JSON.stringify(__props.schema.default)), 1)])) : createCommentVNode("", true),
91
- __props.schema.description ? (openBlock(), createElementBlock("span", _hoisted_22, " — " + toDisplayString(__props.schema.description), 1)) : createCommentVNode("", true)
147
+ createElementVNode("code", null, toDisplayString(getSchemaType(unref(resolvedSchema))), 1),
148
+ getSchemaFormat(unref(resolvedSchema)) ? (openBlock(), createElementBlock("span", _hoisted_19, [_cache[12] || (_cache[12] = createTextVNode(", format: ", -1)), createElementVNode("code", null, toDisplayString(getSchemaFormat(unref(resolvedSchema))), 1)])) : createCommentVNode("", true),
149
+ getSchemaEnum(unref(resolvedSchema)) ? (openBlock(), createElementBlock("span", _hoisted_20, [_cache[13] || (_cache[13] = createTextVNode(", possible values: ", -1)), createElementVNode("code", null, toDisplayString(formatEnumValues(getSchemaEnum(unref(resolvedSchema)))), 1)])) : createCommentVNode("", true),
150
+ getSchemaDefault(unref(resolvedSchema)) !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_21, [_cache[14] || (_cache[14] = createTextVNode(", default: ", -1)), createElementVNode("code", null, toDisplayString(JSON.stringify(getSchemaDefault(unref(resolvedSchema)))), 1)])) : createCommentVNode("", true),
151
+ getSchemaDescription(unref(resolvedSchema)) ? (openBlock(), createElementBlock("span", _hoisted_22, " — " + toDisplayString(getSchemaDescription(unref(resolvedSchema))), 1)) : createCommentVNode("", true)
92
152
  ])]))])) : createCommentVNode("", true);
93
153
  };
94
154
  }
@@ -108,7 +168,7 @@ var XmlOrJson_default = /* @__PURE__ */ defineComponent({
108
168
  type: Boolean,
109
169
  default: false
110
170
  },
111
- modelValue: { type: [Object, Boolean] }
171
+ modelValue: {}
112
172
  },
113
173
  setup(__props) {
114
174
  return (_ctx, _cache) => {
@@ -138,6 +198,79 @@ var MarkdownReference_default = /* @__PURE__ */ defineComponent({
138
198
  __name: "MarkdownReference",
139
199
  props: { content: {} },
140
200
  setup(__props) {
201
+ const resolveRefAs = (reference) => {
202
+ const resolved = getResolvedRef(reference);
203
+ return resolved && typeof resolved === "object" ? resolved : null;
204
+ };
205
+ const resolveOperation = (operation) => resolveRefAs(operation);
206
+ const resolveSchema = (schema) => resolveRefAs(schema);
207
+ const resolveRequestBody = (body) => resolveRefAs(body);
208
+ const resolveResponse = (response) => resolveRefAs(response);
209
+ const toRequestBodyView = (body) => resolveRequestBody(body);
210
+ const toResponseView = (response) => resolveResponse(response);
211
+ const HTTP_METHODS = new Set([
212
+ "get",
213
+ "put",
214
+ "post",
215
+ "delete",
216
+ "options",
217
+ "head",
218
+ "patch",
219
+ "trace"
220
+ ]);
221
+ const operations = computed(() => {
222
+ const paths = __props.content?.paths ?? {};
223
+ return Object.entries(paths).flatMap(([path, pathItem]) => {
224
+ if (!pathItem || typeof pathItem !== "object") return [];
225
+ return Object.entries(pathItem).flatMap(([method, operation]) => {
226
+ if (!HTTP_METHODS.has(method)) return [];
227
+ const resolvedOperation = resolveOperation(operation);
228
+ if (!resolvedOperation) return [];
229
+ return [{
230
+ path,
231
+ method,
232
+ operation: resolvedOperation,
233
+ requestBody: toRequestBodyView(resolvedOperation.requestBody),
234
+ responses: Object.entries(resolvedOperation.responses ?? {}).flatMap(([statusCode, response]) => {
235
+ const resolvedResponse = toResponseView(response);
236
+ if (!resolvedResponse) return [];
237
+ return [{
238
+ statusCode,
239
+ response: resolvedResponse
240
+ }];
241
+ })
242
+ }];
243
+ });
244
+ });
245
+ });
246
+ const webhooks = computed(() => {
247
+ const webhookItems = __props.content?.webhooks ?? {};
248
+ return Object.entries(webhookItems).flatMap(([name, pathItem]) => {
249
+ if (!pathItem || typeof pathItem !== "object") return [];
250
+ return Object.entries(pathItem).flatMap(([method, operation]) => {
251
+ if (!HTTP_METHODS.has(method)) return [];
252
+ const resolvedOperation = resolveOperation(operation);
253
+ if (!resolvedOperation) return [];
254
+ return [{
255
+ name,
256
+ method,
257
+ operation: resolvedOperation
258
+ }];
259
+ });
260
+ });
261
+ });
262
+ const componentSchemas = computed(() => {
263
+ const schemas = __props.content?.components?.schemas ?? {};
264
+ return Object.entries(schemas).flatMap(([name, schema]) => {
265
+ const resolvedSchema = resolveSchema(schema);
266
+ if (!resolvedSchema) return [];
267
+ return [{
268
+ name,
269
+ schema: resolvedSchema
270
+ }];
271
+ });
272
+ });
273
+ const getSchemaView = (schema) => schema;
141
274
  return (_ctx, _cache) => {
142
275
  return openBlock(), createElementBlock("section", null, [
143
276
  createElementVNode("header", null, [createElementVNode("h1", null, toDisplayString(__props.content?.info?.title), 1), createElementVNode("ul", null, [createElementVNode("li", null, [
@@ -169,80 +302,76 @@ var MarkdownReference_default = /* @__PURE__ */ defineComponent({
169
302
  }), 128))])])) : createCommentVNode("", true)])
170
303
  ]);
171
304
  }), 128))])])) : createCommentVNode("", true),
172
- Object.keys(__props.content?.paths ?? {}).length ? (openBlock(), createElementBlock("section", _hoisted_4, [_cache[21] || (_cache[21] = createElementVNode("h2", null, "Operations", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(Object.keys(__props.content?.paths ?? {}), (path) => {
173
- return openBlock(), createElementBlock(Fragment, { key: path }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.content?.paths?.[path], (operation, method) => {
174
- return openBlock(), createElementBlock("section", { key: operation }, [
175
- createElementVNode("header", null, [createElementVNode("h3", null, [operation.summary ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(operation.summary), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(method.toString().toUpperCase()) + " " + toDisplayString(path), 1)], 64)), operation["x-scalar-stability"] ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(" (" + toDisplayString(operation["x-scalar-stability"]) + ") ", 1)], 64)) : operation.deprecated ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createTextVNode(" ⚠️ Deprecated ")], 64)) : createCommentVNode("", true)])]),
176
- createElementVNode("ul", null, [
177
- createElementVNode("li", null, [
178
- _cache[11] || (_cache[11] = createElementVNode("strong", null, "Method:", -1)),
179
- _cache[12] || (_cache[12] = createTextVNode("\xA0", -1)),
180
- createElementVNode("code", null, toDisplayString(method.toString().toUpperCase()), 1)
181
- ]),
182
- createElementVNode("li", null, [
183
- _cache[13] || (_cache[13] = createElementVNode("strong", null, "Path:", -1)),
184
- _cache[14] || (_cache[14] = createTextVNode("\xA0", -1)),
185
- createElementVNode("code", null, toDisplayString(path), 1)
186
- ]),
187
- operation.tags ? (openBlock(), createElementBlock("li", _hoisted_5, [_cache[15] || (_cache[15] = createElementVNode("strong", null, "Tags:", -1)), createTextVNode("\xA0" + toDisplayString(operation.tags.join(", ")), 1)])) : createCommentVNode("", true),
188
- operation["x-scalar-stability"] ? (openBlock(), createElementBlock("li", _hoisted_6, [_cache[16] || (_cache[16] = createElementVNode("strong", null, "Stability:", -1)), createTextVNode("\xA0" + toDisplayString(operation["x-scalar-stability"]), 1)])) : createCommentVNode("", true)
305
+ operations.value.length ? (openBlock(), createElementBlock("section", _hoisted_4, [_cache[21] || (_cache[21] = createElementVNode("h2", null, "Operations", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(operations.value, (entry) => {
306
+ return openBlock(), createElementBlock("section", { key: `${entry.method}:${entry.path}` }, [
307
+ createElementVNode("header", null, [createElementVNode("h3", null, [entry.operation.summary ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(entry.operation.summary), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(entry.method.toString().toUpperCase()) + " " + toDisplayString(entry.path), 1)], 64)), entry.operation["x-scalar-stability"] ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(" (" + toDisplayString(entry.operation["x-scalar-stability"]) + ") ", 1)], 64)) : entry.operation.deprecated ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createTextVNode(" ⚠️ Deprecated ")], 64)) : createCommentVNode("", true)])]),
308
+ createElementVNode("ul", null, [
309
+ createElementVNode("li", null, [
310
+ _cache[11] || (_cache[11] = createElementVNode("strong", null, "Method:", -1)),
311
+ _cache[12] || (_cache[12] = createTextVNode("\xA0", -1)),
312
+ createElementVNode("code", null, toDisplayString(entry.method.toString().toUpperCase()), 1)
189
313
  ]),
190
- createVNode(unref(ScalarMarkdown), { value: operation.description }, null, 8, ["value"]),
191
- operation.requestBody?.content ? (openBlock(), createElementBlock("section", _hoisted_7, [_cache[18] || (_cache[18] = createElementVNode("h4", null, "Request Body", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(operation.requestBody.content, (content, mediaType) => {
192
- return openBlock(), createElementBlock(Fragment, { key: mediaType }, [createElementVNode("h5", null, "Content-Type: " + toDisplayString(mediaType), 1), content.schema ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
193
- createVNode(Schema_default, { schema: content.schema }, null, 8, ["schema"]),
194
- _cache[17] || (_cache[17] = createElementVNode("p", null, [createElementVNode("strong", null, "Example:")], -1)),
314
+ createElementVNode("li", null, [
315
+ _cache[13] || (_cache[13] = createElementVNode("strong", null, "Path:", -1)),
316
+ _cache[14] || (_cache[14] = createTextVNode("\xA0", -1)),
317
+ createElementVNode("code", null, toDisplayString(entry.path), 1)
318
+ ]),
319
+ entry.operation.tags ? (openBlock(), createElementBlock("li", _hoisted_5, [_cache[15] || (_cache[15] = createElementVNode("strong", null, "Tags:", -1)), createTextVNode("\xA0" + toDisplayString(entry.operation.tags.join(", ")), 1)])) : createCommentVNode("", true),
320
+ entry.operation["x-scalar-stability"] ? (openBlock(), createElementBlock("li", _hoisted_6, [_cache[16] || (_cache[16] = createElementVNode("strong", null, "Stability:", -1)), createTextVNode("\xA0" + toDisplayString(entry.operation["x-scalar-stability"]), 1)])) : createCommentVNode("", true)
321
+ ]),
322
+ createVNode(unref(ScalarMarkdown), { value: entry.operation.description }, null, 8, ["value"]),
323
+ entry.requestBody?.content ? (openBlock(), createElementBlock("section", _hoisted_7, [_cache[18] || (_cache[18] = createElementVNode("h4", null, "Request Body", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(entry.requestBody.content, (bodyContent, mediaType) => {
324
+ return openBlock(), createElementBlock(Fragment, { key: mediaType }, [createElementVNode("h5", null, "Content-Type: " + toDisplayString(mediaType), 1), resolveSchema(bodyContent.schema) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
325
+ createVNode(Schema_default, { schema: resolveSchema(bodyContent.schema) }, null, 8, ["schema"]),
326
+ _cache[17] || (_cache[17] = createElementVNode("p", null, [createElementVNode("strong", null, "Example:")], -1)),
327
+ createVNode(XmlOrJson_default, {
328
+ xml: mediaType?.toString().includes("xml"),
329
+ "model-value": unref(getExampleFromSchema)(resolveSchema(bodyContent.schema), { xml: mediaType?.toString().includes("xml") })
330
+ }, null, 8, ["xml", "model-value"])
331
+ ], 64)) : createCommentVNode("", true)], 64);
332
+ }), 128))])) : createCommentVNode("", true),
333
+ 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) => {
334
+ return openBlock(), createElementBlock("section", { key: entryResponse.statusCode }, [createElementVNode("header", null, [createElementVNode("h5", null, [createTextVNode(" Status: " + toDisplayString(entryResponse.statusCode) + " ", 1), entryResponse.response.description ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(entryResponse.response.description), 1)], 64)) : createCommentVNode("", true)])]), entryResponse.response.content ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(entryResponse.response.content, (responseContent, mediaType) => {
335
+ return openBlock(), createElementBlock("section", { key: mediaType }, [createElementVNode("h6", null, "Content-Type: " + toDisplayString(mediaType), 1), resolveSchema(responseContent.schema) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
336
+ createVNode(Schema_default, { schema: resolveSchema(responseContent.schema) }, null, 8, ["schema"]),
337
+ _cache[19] || (_cache[19] = createElementVNode("p", null, [createElementVNode("strong", null, "Example:")], -1)),
195
338
  createVNode(XmlOrJson_default, {
196
339
  xml: mediaType?.toString().includes("xml"),
197
- "model-value": unref(getExampleFromSchema)(content.schema, { xml: mediaType?.toString().includes("xml") })
340
+ "model-value": unref(getExampleFromSchema)(resolveSchema(responseContent.schema), { xml: mediaType?.toString().includes("xml") })
198
341
  }, null, 8, ["xml", "model-value"])
199
- ], 64)) : createCommentVNode("", true)], 64);
200
- }), 128))])) : createCommentVNode("", true),
201
- operation.responses ? (openBlock(), createElementBlock("section", _hoisted_8, [_cache[20] || (_cache[20] = createElementVNode("h4", null, "Responses", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(operation.responses, (response, statusCode) => {
202
- return openBlock(), createElementBlock("section", { key: statusCode }, [createElementVNode("header", null, [createElementVNode("h5", null, [createTextVNode(" Status: " + toDisplayString(statusCode) + " ", 1), response.description ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(response.description), 1)], 64)) : createCommentVNode("", true)])]), (openBlock(true), createElementBlock(Fragment, null, renderList(response.content, (content, mediaType) => {
203
- return openBlock(), createElementBlock("section", { key: mediaType }, [createElementVNode("h6", null, "Content-Type: " + toDisplayString(mediaType), 1), content.schema ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
204
- createVNode(Schema_default, { schema: content.schema }, null, 8, ["schema"]),
205
- _cache[19] || (_cache[19] = createElementVNode("p", null, [createElementVNode("strong", null, "Example:")], -1)),
206
- createVNode(XmlOrJson_default, {
207
- xml: mediaType?.toString().includes("xml"),
208
- "model-value": unref(getExampleFromSchema)(content.schema, { xml: mediaType?.toString().includes("xml") })
209
- }, null, 8, ["xml", "model-value"])
210
- ], 64)) : createCommentVNode("", true)]);
211
- }), 128))]);
212
- }), 128))])) : createCommentVNode("", true)
213
- ]);
214
- }), 128))], 64);
342
+ ], 64)) : createCommentVNode("", true)]);
343
+ }), 128)) : createCommentVNode("", true)]);
344
+ }), 128))])) : createCommentVNode("", true)
345
+ ]);
215
346
  }), 128))])) : createCommentVNode("", true),
216
- Object.keys(__props.content?.webhooks ?? {}).length ? (openBlock(), createElementBlock("section", _hoisted_9, [_cache[26] || (_cache[26] = createElementVNode("h2", null, "Webhooks", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.content?.webhooks, (webhook, name) => {
217
- return openBlock(), createElementBlock(Fragment, { key: name }, [(openBlock(true), createElementBlock(Fragment, null, renderList(webhook, (operation, method) => {
218
- return openBlock(), createElementBlock("section", { key: operation }, [
219
- createElementVNode("header", null, [createElementVNode("h3", null, [operation.summary ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(operation.summary), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(name), 1)], 64)), operation["x-scalar-stability"] ? (openBlock(), createElementBlock("span", _hoisted_10, "(" + toDisplayString(operation["x-scalar-stability"]) + ")", 1)) : operation.deprecated ? (openBlock(), createElementBlock("span", _hoisted_11, "⚠️ Deprecated")) : createCommentVNode("", true)])]),
220
- createElementVNode("ul", null, [
221
- createElementVNode("li", null, [_cache[22] || (_cache[22] = createElementVNode("strong", null, "Method:", -1)), createElementVNode("code", null, toDisplayString(method.toString().toUpperCase()), 1)]),
222
- createElementVNode("li", null, [_cache[23] || (_cache[23] = createElementVNode("strong", null, "Path:", -1)), createElementVNode("code", null, "/webhooks/" + toDisplayString(name), 1)]),
223
- operation.tags ? (openBlock(), createElementBlock("li", _hoisted_12, [_cache[24] || (_cache[24] = createElementVNode("strong", null, "Tags:", -1)), createTextVNode(" " + toDisplayString(operation.tags.join(", ")), 1)])) : createCommentVNode("", true),
224
- operation.deprecated ? (openBlock(), createElementBlock("li", _hoisted_13, [..._cache[25] || (_cache[25] = [createElementVNode("strong", null, "Deprecated", -1)])])) : createCommentVNode("", true)
225
- ]),
226
- createVNode(unref(ScalarMarkdown), { value: operation.description }, null, 8, ["value"])
227
- ]);
228
- }), 128))], 64);
347
+ webhooks.value.length ? (openBlock(), createElementBlock("section", _hoisted_9, [_cache[26] || (_cache[26] = createElementVNode("h2", null, "Webhooks", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(webhooks.value, (webhook) => {
348
+ return openBlock(), createElementBlock("section", { key: `${webhook.name}:${webhook.method}` }, [
349
+ createElementVNode("header", null, [createElementVNode("h3", null, [webhook.operation.summary ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(webhook.operation.summary), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(webhook.name), 1)], 64)), webhook.operation["x-scalar-stability"] ? (openBlock(), createElementBlock("span", _hoisted_10, "(" + toDisplayString(webhook.operation["x-scalar-stability"]) + ")", 1)) : webhook.operation.deprecated ? (openBlock(), createElementBlock("span", _hoisted_11, "⚠️ Deprecated")) : createCommentVNode("", true)])]),
350
+ createElementVNode("ul", null, [
351
+ createElementVNode("li", null, [_cache[22] || (_cache[22] = createElementVNode("strong", null, "Method:", -1)), createElementVNode("code", null, toDisplayString(webhook.method.toString().toUpperCase()), 1)]),
352
+ createElementVNode("li", null, [_cache[23] || (_cache[23] = createElementVNode("strong", null, "Path:", -1)), createElementVNode("code", null, "/webhooks/" + toDisplayString(webhook.name), 1)]),
353
+ webhook.operation.tags ? (openBlock(), createElementBlock("li", _hoisted_12, [_cache[24] || (_cache[24] = createElementVNode("strong", null, "Tags:", -1)), createTextVNode(" " + toDisplayString(webhook.operation.tags.join(", ")), 1)])) : createCommentVNode("", true),
354
+ webhook.operation.deprecated ? (openBlock(), createElementBlock("li", _hoisted_13, [..._cache[25] || (_cache[25] = [createElementVNode("strong", null, "Deprecated", -1)])])) : createCommentVNode("", true)
355
+ ]),
356
+ createVNode(unref(ScalarMarkdown), { value: webhook.operation.description }, null, 8, ["value"])
357
+ ]);
229
358
  }), 128))])) : createCommentVNode("", true),
230
- __props.content?.components?.schemas && Object.keys(__props.content.components.schemas).length ? (openBlock(), createElementBlock("section", _hoisted_14, [_cache[29] || (_cache[29] = createElementVNode("h2", null, "Schemas", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.content.components.schemas, (schema, name) => {
231
- return openBlock(), createElementBlock("section", { key: name }, [
232
- createElementVNode("header", null, [createElementVNode("h3", null, toDisplayString(schema.title ?? name), 1)]),
233
- createElementVNode("ul", null, [createElementVNode("li", null, [_cache[27] || (_cache[27] = createElementVNode("strong", null, "Type:", -1)), createElementVNode("code", null, toDisplayString(schema.type), 1)])]),
234
- schema.description ? (openBlock(), createBlock(unref(ScalarMarkdown), {
359
+ componentSchemas.value.length ? (openBlock(), createElementBlock("section", _hoisted_14, [_cache[29] || (_cache[29] = createElementVNode("h2", null, "Schemas", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(componentSchemas.value, (entry) => {
360
+ return openBlock(), createElementBlock("section", { key: entry.name }, [
361
+ createElementVNode("header", null, [createElementVNode("h3", null, toDisplayString(getSchemaView(entry.schema).title ?? entry.name), 1)]),
362
+ createElementVNode("ul", null, [createElementVNode("li", null, [_cache[27] || (_cache[27] = createElementVNode("strong", null, "Type:", -1)), createElementVNode("code", null, toDisplayString(getSchemaView(entry.schema).type), 1)])]),
363
+ getSchemaView(entry.schema).description ? (openBlock(), createBlock(unref(ScalarMarkdown), {
235
364
  key: 0,
236
- value: schema.description
365
+ value: getSchemaView(entry.schema).description
237
366
  }, null, 8, ["value"])) : createCommentVNode("", true),
238
- schema.type === "object" ? (openBlock(), createBlock(Schema_default, {
367
+ getSchemaView(entry.schema).type === "object" ? (openBlock(), createBlock(Schema_default, {
239
368
  key: 1,
240
- schema
369
+ schema: entry.schema
241
370
  }, null, 8, ["schema"])) : createCommentVNode("", true),
242
371
  _cache[28] || (_cache[28] = createElementVNode("p", null, [createElementVNode("strong", null, "Example:")], -1)),
243
- schema.type === "object" ? (openBlock(), createBlock(XmlOrJson_default, {
372
+ getSchemaView(entry.schema).type === "object" ? (openBlock(), createBlock(XmlOrJson_default, {
244
373
  key: 2,
245
- "model-value": unref(getExampleFromSchema)(schema)
374
+ "model-value": unref(getExampleFromSchema)(entry.schema)
246
375
  }, null, 8, ["model-value"])) : createCommentVNode("", true)
247
376
  ]);
248
377
  }), 128))])) : createCommentVNode("", true)
@@ -252,9 +381,114 @@ var MarkdownReference_default = /* @__PURE__ */ defineComponent({
252
381
  });
253
382
  //#endregion
254
383
  //#region src/create-markdown-from-openapi.ts
255
- async function createHtmlFromOpenApi(input) {
256
- const { schema: content } = dereference(upgrade(normalize(input), "3.1"));
257
- return minify(await renderToString(createSSRApp(MarkdownReference_default, { content })), {
384
+ var HTTP_METHODS = [
385
+ "get",
386
+ "put",
387
+ "post",
388
+ "delete",
389
+ "options",
390
+ "head",
391
+ "patch",
392
+ "trace"
393
+ ];
394
+ var HTTP_METHOD_SET = new Set(HTTP_METHODS);
395
+ var isHttpUrl = (value) => {
396
+ try {
397
+ const url = new URL(value);
398
+ return url.protocol === "http:" || url.protocol === "https:";
399
+ } catch {
400
+ return false;
401
+ }
402
+ };
403
+ var toWorkspaceInput = (input) => {
404
+ if (typeof input !== "string") return { document: input };
405
+ const normalized = normalize(input);
406
+ if (isObject(normalized)) return { document: normalized };
407
+ if (isHttpUrl(input)) return { url: input };
408
+ return { path: input };
409
+ };
410
+ var normalizeHttpMethod = (method) => {
411
+ const normalized = method.toLowerCase();
412
+ if (HTTP_METHOD_SET.has(normalized)) return normalized;
413
+ return null;
414
+ };
415
+ var normalizeJsonPointer = (pointer) => {
416
+ if (pointer.startsWith("#/")) return pointer.slice(1);
417
+ if (pointer.startsWith("/")) return pointer;
418
+ throw new Error(`Invalid JSON pointer "${pointer}". JSON pointers must start with "#/"`);
419
+ };
420
+ var parseJsonPointer = (pointer) => normalizeJsonPointer(pointer).slice(1).split("/").map((segment) => segment.replaceAll("~1", "/").replaceAll("~0", "~"));
421
+ var getOperationSelectorFromPointer = (pointer) => {
422
+ const segments = parseJsonPointer(pointer);
423
+ if (segments.length !== 3 || segments[0] !== "paths") throw new Error(`JSON pointer "${pointer}" must target an operation object under "/paths/{path}/{method}"`);
424
+ const path = segments[1];
425
+ const method = segments[2];
426
+ if (!path || !method) throw new Error(`JSON pointer "${pointer}" must target an operation object under "/paths/{path}/{method}"`);
427
+ return {
428
+ path,
429
+ method
430
+ };
431
+ };
432
+ var getPathEntries = (document) => {
433
+ const paths = document.paths;
434
+ if (!isObject(paths)) return [];
435
+ return Object.entries(paths).flatMap(([path, pathItem]) => isObject(pathItem) ? [[path, pathItem]] : []);
436
+ };
437
+ var filterPathItemToSingleOperation = (pathItem, selectedMethod) => Object.fromEntries(Object.entries(pathItem).filter(([key]) => {
438
+ const method = normalizeHttpMethod(key);
439
+ return !method || method === selectedMethod;
440
+ }));
441
+ var findOperationByPathAndMethod = (document, selector) => {
442
+ const method = normalizeHttpMethod(selector.method);
443
+ if (!method) throw new Error(`Invalid HTTP method "${selector.method}". Supported methods: ${HTTP_METHODS.join(", ")}`);
444
+ const pathItem = getPathEntries(document).find(([path]) => path === selector.path)?.[1];
445
+ if (!pathItem || !(method in pathItem)) throw new Error(`Operation not found for path "${selector.path}" and method "${method.toUpperCase()}"`);
446
+ return {
447
+ path: selector.path,
448
+ method
449
+ };
450
+ };
451
+ var findOperationsByOperationId = (document, operationId) => getPathEntries(document).flatMap(([path, pathItem]) => Object.entries(pathItem).flatMap(([methodKey, operation]) => {
452
+ const method = normalizeHttpMethod(methodKey);
453
+ if (!method || !isObject(operation)) return [];
454
+ if (("operationId" in operation && typeof operation.operationId === "string" ? operation.operationId : void 0) !== operationId) return [];
455
+ return [{
456
+ path,
457
+ method
458
+ }];
459
+ }));
460
+ var resolveOperationMatch = (document, selector) => {
461
+ if ("pointer" in selector) return findOperationByPathAndMethod(document, getOperationSelectorFromPointer(selector.pointer));
462
+ if ("operationId" in selector) {
463
+ const matches = findOperationsByOperationId(document, selector.operationId);
464
+ if (!matches.length) throw new Error(`Operation with operationId "${selector.operationId}" was not found`);
465
+ if (matches.length > 1) {
466
+ const uniqueCandidates = matches.map(({ path, method }) => `"${method.toUpperCase()} ${path}"`);
467
+ throw new Error(`Multiple operations found for operationId "${selector.operationId}". Use { path, method } instead. Matches: ${uniqueCandidates.join(", ")}`);
468
+ }
469
+ return matches[0];
470
+ }
471
+ return findOperationByPathAndMethod(document, selector);
472
+ };
473
+ var filterDocumentByOperation = (document, selector) => {
474
+ const match = resolveOperationMatch(document, selector);
475
+ const pathItem = getPathEntries(document).find(([path]) => path === match.path)?.[1];
476
+ if (!pathItem) throw new Error(`Operation not found for path "${match.path}" and method "${match.method.toUpperCase()}"`);
477
+ return {
478
+ ...document,
479
+ paths: { [match.path]: filterPathItemToSingleOperation(pathItem, match.method) }
480
+ };
481
+ };
482
+ async function createHtmlFromOpenApi(input, options) {
483
+ const workspaceStore = createWorkspaceStore({ fileLoader: readFiles() });
484
+ const name = "openapi-to-markdown";
485
+ if (!await workspaceStore.addDocument({
486
+ name,
487
+ ...toWorkspaceInput(input)
488
+ })) throw new Error("Failed to load OpenAPI document");
489
+ const content = workspaceStore.workspace.documents[name];
490
+ if (!content) throw new Error("OpenAPI document could not be resolved");
491
+ return minify(await renderToString(createSSRApp(MarkdownReference_default, { content: options?.operation && isObject(content) ? filterDocumentByOperation(content, options.operation) : content })), {
258
492
  removeComments: true,
259
493
  removeEmptyElements: true,
260
494
  collapseWhitespace: true,
@@ -266,8 +500,8 @@ async function createHtmlFromOpenApi(input) {
266
500
  useShortDoctype: true
267
501
  });
268
502
  }
269
- async function createMarkdownFromOpenApi(content) {
270
- return markdownFromHtml(await createHtmlFromOpenApi(content));
503
+ async function createMarkdownFromOpenApi(content, options) {
504
+ return markdownFromHtml(await createHtmlFromOpenApi(content, options));
271
505
  }
272
506
  async function markdownFromHtml(html) {
273
507
  const file = await unified().use(rehypeParse, { fragment: true }).use(remarkGfm).use(rehypeSanitize).use(rehypeRemark).use(remarkStringify, { bullet: "-" }).process(html);
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 type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\ndefineProps<{\n schema: OpenAPIV3_1.SchemaObject\n}>()\n\n// Sort properties to show required fields first, then optional, then metadata\nconst sortProperties = (\n properties: Record<string, OpenAPIV3_1.SchemaObject>,\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=\"schema\">\n <!-- Composition keywords -->\n <template v-if=\"schema.allOf\">\n <section>\n <header>\n <strong>All of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in schema.allOf\"\n :key=\"index\">\n <Schema :schema=\"subSchema\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"schema.anyOf\">\n <section>\n <header>\n <strong>Any of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in schema.anyOf\"\n :key=\"index\">\n <Schema :schema=\"subSchema\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"schema.oneOf\">\n <section>\n <header>\n <strong>One of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in schema.oneOf\"\n :key=\"index\">\n <Schema :schema=\"subSchema\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"schema.not\">\n <section>\n <header>\n <strong>Not:</strong>\n </header>\n <section>\n <Schema :schema=\"schema.not\" />\n </section>\n </section>\n </template>\n\n <!-- Object type -->\n <template v-else-if=\"schema.type === 'object' || schema.properties\">\n <section>\n <ul>\n <template\n v-for=\"(propSchema, propName) in sortProperties(\n schema.properties || {},\n schema.required,\n )\"\n :key=\"propName\">\n <li>\n <strong>\n <code>{{ propName }}</code>\n <span v-if=\"schema.required?.includes(propName)\">\n (required)\n </span>\n </strong>\n <p>\n <code>\n {{\n Array.isArray(propSchema.type)\n ? propSchema.type.join(' | ')\n : propSchema.type || 'object'\n }}\n </code>\n <template v-if=\"propSchema.format\">\n <span\n >, format: <code>{{ propSchema.format }}</code></span\n >\n </template>\n <template v-if=\"propSchema.enum\">\n <span\n >, possible values:\n <code>{{\n (propSchema.enum as unknown[])\n .map((e: unknown) => JSON.stringify(e))\n .join(', ')\n }}</code>\n </span>\n </template>\n <template v-if=\"propSchema.default !== undefined\">\n <span\n >, default:\n <code>{{ JSON.stringify(propSchema.default) }}</code></span\n >\n </template>\n <template v-if=\"propSchema.description\">\n <span> — {{ propSchema.description }}</span>\n </template>\n </p>\n <Schema\n v-if=\"propSchema.type === 'object' || propSchema.properties\"\n :schema=\"propSchema\" />\n <template v-if=\"propSchema.type === 'array' && propSchema.items\">\n <section>\n <header>\n <strong>Items:</strong>\n </header>\n <Schema :schema=\"propSchema.items\" />\n </section>\n </template>\n </li>\n </template>\n </ul>\n </section>\n </template>\n\n <!-- Array type -->\n <template v-else-if=\"schema.type === 'array' && schema.items\">\n <section>\n <header>\n <strong>Array of:</strong>\n </header>\n <section>\n <Schema :schema=\"schema.items\" />\n </section>\n <ul\n v-if=\"\n schema.minItems !== undefined ||\n schema.maxItems !== undefined ||\n schema.uniqueItems\n \">\n <li v-if=\"schema.minItems !== undefined\">\n Min items: <code>{{ schema.minItems }}</code>\n </li>\n <li v-if=\"schema.maxItems !== undefined\">\n Max items: <code>{{ schema.maxItems }}</code>\n </li>\n <li v-if=\"schema.uniqueItems\">Unique items: <code>true</code></li>\n </ul>\n </section>\n </template>\n\n <!-- Primitive types -->\n <template v-else>\n <section>\n <p>\n <code>{{ schema.type }}</code>\n <template v-if=\"schema.format\">\n <span\n >, format: <code>{{ schema.format }}</code></span\n >\n </template>\n <template v-if=\"schema.enum\">\n <span\n >, possible values:\n <code>{{\n (schema.enum as unknown[])\n .map((e: unknown) => JSON.stringify(e))\n .join(', ')\n }}</code>\n </span>\n </template>\n <template v-if=\"schema.default !== undefined\">\n <span\n >, default:\n <code>{{ JSON.stringify(schema.default) }}</code></span\n >\n </template>\n <template v-if=\"schema.description\">\n <span> — {{ schema.description }}</span>\n </template>\n </p>\n </section>\n </template>\n </section>\n</template>\n","<script setup lang=\"ts\">\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\ndefineProps<{\n schema: OpenAPIV3_1.SchemaObject\n}>()\n\n// Sort properties to show required fields first, then optional, then metadata\nconst sortProperties = (\n properties: Record<string, OpenAPIV3_1.SchemaObject>,\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=\"schema\">\n <!-- Composition keywords -->\n <template v-if=\"schema.allOf\">\n <section>\n <header>\n <strong>All of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in schema.allOf\"\n :key=\"index\">\n <Schema :schema=\"subSchema\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"schema.anyOf\">\n <section>\n <header>\n <strong>Any of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in schema.anyOf\"\n :key=\"index\">\n <Schema :schema=\"subSchema\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"schema.oneOf\">\n <section>\n <header>\n <strong>One of:</strong>\n </header>\n <section\n v-for=\"(subSchema, index) in schema.oneOf\"\n :key=\"index\">\n <Schema :schema=\"subSchema\" />\n </section>\n </section>\n </template>\n\n <template v-else-if=\"schema.not\">\n <section>\n <header>\n <strong>Not:</strong>\n </header>\n <section>\n <Schema :schema=\"schema.not\" />\n </section>\n </section>\n </template>\n\n <!-- Object type -->\n <template v-else-if=\"schema.type === 'object' || schema.properties\">\n <section>\n <ul>\n <template\n v-for=\"(propSchema, propName) in sortProperties(\n schema.properties || {},\n schema.required,\n )\"\n :key=\"propName\">\n <li>\n <strong>\n <code>{{ propName }}</code>\n <span v-if=\"schema.required?.includes(propName)\">\n (required)\n </span>\n </strong>\n <p>\n <code>\n {{\n Array.isArray(propSchema.type)\n ? propSchema.type.join(' | ')\n : propSchema.type || 'object'\n }}\n </code>\n <template v-if=\"propSchema.format\">\n <span\n >, format: <code>{{ propSchema.format }}</code></span\n >\n </template>\n <template v-if=\"propSchema.enum\">\n <span\n >, possible values:\n <code>{{\n (propSchema.enum as unknown[])\n .map((e: unknown) => JSON.stringify(e))\n .join(', ')\n }}</code>\n </span>\n </template>\n <template v-if=\"propSchema.default !== undefined\">\n <span\n >, default:\n <code>{{ JSON.stringify(propSchema.default) }}</code></span\n >\n </template>\n <template v-if=\"propSchema.description\">\n <span> — {{ propSchema.description }}</span>\n </template>\n </p>\n <Schema\n v-if=\"propSchema.type === 'object' || propSchema.properties\"\n :schema=\"propSchema\" />\n <template v-if=\"propSchema.type === 'array' && propSchema.items\">\n <section>\n <header>\n <strong>Items:</strong>\n </header>\n <Schema :schema=\"propSchema.items\" />\n </section>\n </template>\n </li>\n </template>\n </ul>\n </section>\n </template>\n\n <!-- Array type -->\n <template v-else-if=\"schema.type === 'array' && schema.items\">\n <section>\n <header>\n <strong>Array of:</strong>\n </header>\n <section>\n <Schema :schema=\"schema.items\" />\n </section>\n <ul\n v-if=\"\n schema.minItems !== undefined ||\n schema.maxItems !== undefined ||\n schema.uniqueItems\n \">\n <li v-if=\"schema.minItems !== undefined\">\n Min items: <code>{{ schema.minItems }}</code>\n </li>\n <li v-if=\"schema.maxItems !== undefined\">\n Max items: <code>{{ schema.maxItems }}</code>\n </li>\n <li v-if=\"schema.uniqueItems\">Unique items: <code>true</code></li>\n </ul>\n </section>\n </template>\n\n <!-- Primitive types -->\n <template v-else>\n <section>\n <p>\n <code>{{ schema.type }}</code>\n <template v-if=\"schema.format\">\n <span\n >, format: <code>{{ schema.format }}</code></span\n >\n </template>\n <template v-if=\"schema.enum\">\n <span\n >, possible values:\n <code>{{\n (schema.enum as unknown[])\n .map((e: unknown) => JSON.stringify(e))\n .join(', ')\n }}</code>\n </span>\n </template>\n <template v-if=\"schema.default !== undefined\">\n <span\n >, default:\n <code>{{ JSON.stringify(schema.default) }}</code></span\n >\n </template>\n <template v-if=\"schema.description\">\n <span> — {{ schema.description }}</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 { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nwithDefaults(\n defineProps<{\n xml?: boolean\n modelValue: OpenAPIV3_1.SchemaObject\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 { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nwithDefaults(\n defineProps<{\n xml?: boolean\n modelValue: OpenAPIV3_1.SchemaObject\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 type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\n// import { snippetz, type HarRequest } from '@scalar/snippetz'\n\nimport Schema from './Schema.vue'\nimport XmlOrJson from './XmlOrJson.vue'\n\nconst { content } = defineProps<{\n content: OpenAPIV3_1.Document\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</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=\"Object.keys(content?.paths ?? {}).length\">\n <h2>Operations</h2>\n\n <template\n v-for=\"path in Object.keys(content?.paths ?? {})\"\n :key=\"path\">\n <template\n v-for=\"(operation, method) in content?.paths?.[path]\"\n :key=\"operation\">\n <section>\n <header>\n <h3>\n <template v-if=\"operation.summary\">\n {{ operation.summary }}\n </template>\n <template v-else>\n {{ method.toString().toUpperCase() }} {{ path }}\n </template>\n <template v-if=\"operation['x-scalar-stability']\">\n ({{ operation['x-scalar-stability'] }})\n </template>\n <template v-else-if=\"operation.deprecated\">\n ⚠️ Deprecated\n </template>\n </h3>\n </header>\n\n <ul>\n <li>\n <strong>Method:</strong>&nbsp;<code>{{\n method.toString().toUpperCase()\n }}</code>\n </li>\n <li>\n <strong>Path:</strong>&nbsp;<code>{{ path }}</code>\n </li>\n <template v-if=\"operation.tags\">\n <li>\n <strong>Tags:</strong>&nbsp;{{ operation.tags.join(', ') }}\n </li>\n </template>\n <template v-if=\"operation['x-scalar-stability']\">\n <li>\n <strong>Stability:</strong>&nbsp;{{\n operation['x-scalar-stability']\n }}\n </li>\n </template>\n </ul>\n\n <ScalarMarkdown :value=\"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=\"operation.requestBody?.content\">\n <section>\n <h4>Request Body</h4>\n <template\n v-for=\"(content, mediaType) in operation.requestBody.content\"\n :key=\"mediaType\">\n <h5>Content-Type: {{ mediaType }}</h5>\n <template v-if=\"content.schema\">\n <Schema :schema=\"content.schema\" />\n <p><strong>Example:</strong></p>\n <XmlOrJson\n :xml=\"mediaType?.toString().includes('xml')\"\n :model-value=\"\n getExampleFromSchema(content.schema, {\n xml: mediaType?.toString().includes('xml'),\n })\n \" />\n </template>\n </template>\n </section>\n </template>\n\n <template v-if=\"operation.responses\">\n <section>\n <h4>Responses</h4>\n\n <template\n v-for=\"(response, statusCode) in operation.responses\"\n :key=\"statusCode\">\n <section>\n <header>\n <h5>\n Status: {{ statusCode }}\n <template v-if=\"response.description\">\n {{ response.description }}\n </template>\n </h5>\n </header>\n <template\n v-for=\"(content, mediaType) in response.content\"\n :key=\"mediaType\">\n <section>\n <h6>Content-Type: {{ mediaType }}</h6>\n <template v-if=\"content.schema\">\n <Schema :schema=\"content.schema\" />\n <p><strong>Example:</strong></p>\n <XmlOrJson\n :xml=\"mediaType?.toString().includes('xml')\"\n :model-value=\"\n getExampleFromSchema(content.schema, {\n xml: mediaType?.toString().includes('xml'),\n })\n \" />\n </template>\n </section>\n </template>\n </section>\n </template>\n </section>\n </template>\n </section>\n </template>\n </template>\n </section>\n\n <section v-if=\"Object.keys(content?.webhooks ?? {}).length\">\n <h2>Webhooks</h2>\n\n <template\n v-for=\"(webhook, name) in content?.webhooks\"\n :key=\"name\">\n <template\n v-for=\"(operation, method) in webhook\"\n :key=\"operation\">\n <section>\n <header>\n <h3>\n <template v-if=\"operation.summary\">\n {{ operation.summary }}\n </template>\n <template v-else>\n {{ name }}\n </template>\n <template v-if=\"operation['x-scalar-stability']\">\n <span>({{ operation['x-scalar-stability'] }})</span>\n </template>\n <template v-else-if=\"operation.deprecated\">\n <span>⚠️ Deprecated</span>\n </template>\n </h3>\n </header>\n\n <ul>\n <li>\n <strong>Method:</strong>\n <code>{{ method.toString().toUpperCase() }}</code>\n </li>\n <li>\n <strong>Path:</strong>\n <code>/webhooks/{{ name }}</code>\n </li>\n <template v-if=\"operation.tags\">\n <li>\n <strong>Tags:</strong>\n {{ operation.tags.join(', ') }}\n </li>\n </template>\n <template v-if=\"operation.deprecated\">\n <li><strong>Deprecated</strong></li>\n </template>\n </ul>\n\n <ScalarMarkdown :value=\"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 </template>\n </section>\n\n <section\n v-if=\"\n content?.components?.schemas &&\n Object.keys(content.components.schemas).length\n \">\n <h2>Schemas</h2>\n <template\n v-for=\"(schema, name) in content.components.schemas\"\n :key=\"name\">\n <section>\n <header>\n <h3>{{ schema.title ?? name }}</h3>\n </header>\n <ul>\n <li>\n <strong>Type:</strong>\n <code>{{ schema.type }}</code>\n </li>\n </ul>\n <template v-if=\"schema.description\">\n <ScalarMarkdown :value=\"schema.description\" />\n </template>\n <Schema\n v-if=\"schema.type === 'object'\"\n :schema=\"schema\" />\n <p><strong>Example:</strong></p>\n <template v-if=\"schema.type === 'object'\">\n <XmlOrJson :model-value=\"getExampleFromSchema(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 type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\n// import { snippetz, type HarRequest } from '@scalar/snippetz'\n\nimport Schema from './Schema.vue'\nimport XmlOrJson from './XmlOrJson.vue'\n\nconst { content } = defineProps<{\n content: OpenAPIV3_1.Document\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</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=\"Object.keys(content?.paths ?? {}).length\">\n <h2>Operations</h2>\n\n <template\n v-for=\"path in Object.keys(content?.paths ?? {})\"\n :key=\"path\">\n <template\n v-for=\"(operation, method) in content?.paths?.[path]\"\n :key=\"operation\">\n <section>\n <header>\n <h3>\n <template v-if=\"operation.summary\">\n {{ operation.summary }}\n </template>\n <template v-else>\n {{ method.toString().toUpperCase() }} {{ path }}\n </template>\n <template v-if=\"operation['x-scalar-stability']\">\n ({{ operation['x-scalar-stability'] }})\n </template>\n <template v-else-if=\"operation.deprecated\">\n ⚠️ Deprecated\n </template>\n </h3>\n </header>\n\n <ul>\n <li>\n <strong>Method:</strong>&nbsp;<code>{{\n method.toString().toUpperCase()\n }}</code>\n </li>\n <li>\n <strong>Path:</strong>&nbsp;<code>{{ path }}</code>\n </li>\n <template v-if=\"operation.tags\">\n <li>\n <strong>Tags:</strong>&nbsp;{{ operation.tags.join(', ') }}\n </li>\n </template>\n <template v-if=\"operation['x-scalar-stability']\">\n <li>\n <strong>Stability:</strong>&nbsp;{{\n operation['x-scalar-stability']\n }}\n </li>\n </template>\n </ul>\n\n <ScalarMarkdown :value=\"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=\"operation.requestBody?.content\">\n <section>\n <h4>Request Body</h4>\n <template\n v-for=\"(content, mediaType) in operation.requestBody.content\"\n :key=\"mediaType\">\n <h5>Content-Type: {{ mediaType }}</h5>\n <template v-if=\"content.schema\">\n <Schema :schema=\"content.schema\" />\n <p><strong>Example:</strong></p>\n <XmlOrJson\n :xml=\"mediaType?.toString().includes('xml')\"\n :model-value=\"\n getExampleFromSchema(content.schema, {\n xml: mediaType?.toString().includes('xml'),\n })\n \" />\n </template>\n </template>\n </section>\n </template>\n\n <template v-if=\"operation.responses\">\n <section>\n <h4>Responses</h4>\n\n <template\n v-for=\"(response, statusCode) in operation.responses\"\n :key=\"statusCode\">\n <section>\n <header>\n <h5>\n Status: {{ statusCode }}\n <template v-if=\"response.description\">\n {{ response.description }}\n </template>\n </h5>\n </header>\n <template\n v-for=\"(content, mediaType) in response.content\"\n :key=\"mediaType\">\n <section>\n <h6>Content-Type: {{ mediaType }}</h6>\n <template v-if=\"content.schema\">\n <Schema :schema=\"content.schema\" />\n <p><strong>Example:</strong></p>\n <XmlOrJson\n :xml=\"mediaType?.toString().includes('xml')\"\n :model-value=\"\n getExampleFromSchema(content.schema, {\n xml: mediaType?.toString().includes('xml'),\n })\n \" />\n </template>\n </section>\n </template>\n </section>\n </template>\n </section>\n </template>\n </section>\n </template>\n </template>\n </section>\n\n <section v-if=\"Object.keys(content?.webhooks ?? {}).length\">\n <h2>Webhooks</h2>\n\n <template\n v-for=\"(webhook, name) in content?.webhooks\"\n :key=\"name\">\n <template\n v-for=\"(operation, method) in webhook\"\n :key=\"operation\">\n <section>\n <header>\n <h3>\n <template v-if=\"operation.summary\">\n {{ operation.summary }}\n </template>\n <template v-else>\n {{ name }}\n </template>\n <template v-if=\"operation['x-scalar-stability']\">\n <span>({{ operation['x-scalar-stability'] }})</span>\n </template>\n <template v-else-if=\"operation.deprecated\">\n <span>⚠️ Deprecated</span>\n </template>\n </h3>\n </header>\n\n <ul>\n <li>\n <strong>Method:</strong>\n <code>{{ method.toString().toUpperCase() }}</code>\n </li>\n <li>\n <strong>Path:</strong>\n <code>/webhooks/{{ name }}</code>\n </li>\n <template v-if=\"operation.tags\">\n <li>\n <strong>Tags:</strong>\n {{ operation.tags.join(', ') }}\n </li>\n </template>\n <template v-if=\"operation.deprecated\">\n <li><strong>Deprecated</strong></li>\n </template>\n </ul>\n\n <ScalarMarkdown :value=\"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 </template>\n </section>\n\n <section\n v-if=\"\n content?.components?.schemas &&\n Object.keys(content.components.schemas).length\n \">\n <h2>Schemas</h2>\n <template\n v-for=\"(schema, name) in content.components.schemas\"\n :key=\"name\">\n <section>\n <header>\n <h3>{{ schema.title ?? name }}</h3>\n </header>\n <ul>\n <li>\n <strong>Type:</strong>\n <code>{{ schema.type }}</code>\n </li>\n </ul>\n <template v-if=\"schema.description\">\n <ScalarMarkdown :value=\"schema.description\" />\n </template>\n <Schema\n v-if=\"schema.type === 'object'\"\n :schema=\"schema\" />\n <p><strong>Example:</strong></p>\n <template v-if=\"schema.type === 'object'\">\n <XmlOrJson :model-value=\"getExampleFromSchema(schema)\" />\n </template>\n </section>\n </template>\n </section>\n </section>\n</template>\n","import { dereference, normalize } from '@scalar/openapi-parser'\nimport type { OpenAPI } from '@scalar/openapi-types'\nimport { upgrade } from '@scalar/openapi-upgrader'\nimport type { UnknownObject } from '@scalar/types/utils'\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 = OpenAPI.Document | Record<string, unknown> | string\n\nexport async function createHtmlFromOpenApi(input: AnyDocument) {\n // TODO: Use the new store here.\n const upgraded = upgrade(normalize(input) as UnknownObject, '3.1')\n const { schema: content } = dereference(upgraded)\n\n // Create and configure a server-side rendered Vue app\n const app = createSSRApp(MarkdownReference, {\n content,\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) {\n return markdownFromHtml(await createHtmlFromOpenApi(content))\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(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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 { schema } = defineProps<{\n schema: MaybeRefSchemaObject\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=\"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 :schema=\"subSchema\" />\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 :schema=\"subSchema\" />\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 :schema=\"subSchema\" />\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 :schema=\"getSchemaNot(resolvedSchema)!\" />\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 <template\n v-if=\"\n getResolvedSchemaType(propSchema) === 'array' &&\n getResolvedSchemaItems(propSchema)\n \">\n <section>\n <header>\n <strong>Items:</strong>\n </header>\n <Schema :schema=\"getResolvedSchemaItems(propSchema)!\" />\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 :schema=\"getSchemaItems(resolvedSchema)!\" />\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 { schema } = defineProps<{\n schema: MaybeRefSchemaObject\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=\"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 :schema=\"subSchema\" />\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 :schema=\"subSchema\" />\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 :schema=\"subSchema\" />\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 :schema=\"getSchemaNot(resolvedSchema)!\" />\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 <template\n v-if=\"\n getResolvedSchemaType(propSchema) === 'array' &&\n getResolvedSchemaItems(propSchema)\n \">\n <section>\n <header>\n <strong>Items:</strong>\n </header>\n <Schema :schema=\"getResolvedSchemaItems(propSchema)!\" />\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 :schema=\"getSchemaItems(resolvedSchema)!\" />\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECYA,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,M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,OAAM,IAAI,MAAM,kCAAkC;CAGpD,MAAM,UAAU,eAAe,UAAU,UAAU;AAEnD,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,yCAAyC;AAiB3D,QAAO,OAHM,MAAM,eALP,aAAa,2BAAmB,EAC1C,SANA,SAAS,aAAa,SAAS,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"}
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "llm",
17
17
  "swagger"
18
18
  ],
19
- "version": "0.4.16",
19
+ "version": "0.5.1",
20
20
  "engines": {
21
21
  "node": ">=22"
22
22
  },
@@ -52,25 +52,23 @@
52
52
  "remark-gfm": "^4.0.1",
53
53
  "remark-stringify": "^11.0.0",
54
54
  "unified": "^11.0.5",
55
- "vue": "^3.5.26",
56
- "@scalar/components": "0.21.2",
57
- "@scalar/helpers": "0.4.2",
58
- "@scalar/openapi-parser": "0.25.7",
59
- "@scalar/oas-utils": "0.10.14",
60
- "@scalar/openapi-types": "0.6.1",
61
- "@scalar/openapi-upgrader": "0.2.3",
62
- "@scalar/types": "0.7.5"
55
+ "vue": "^3.5.30",
56
+ "@scalar/components": "0.21.3",
57
+ "@scalar/json-magic": "0.12.5",
58
+ "@scalar/oas-utils": "0.10.16",
59
+ "@scalar/helpers": "0.4.3",
60
+ "@scalar/workspace-store": "0.43.1"
63
61
  },
64
62
  "devDependencies": {
65
- "@hono/node-server": "^1.19.7",
63
+ "@hono/node-server": "^1.19.10",
66
64
  "@types/html-minifier-terser": "^7.0.2",
67
65
  "@vitejs/plugin-vue": "^6.0.3",
68
66
  "@vue/test-utils": "2.4.6",
69
- "hono": "4.12.4",
67
+ "hono": "^4.12.7",
70
68
  "vite": "8.0.0",
71
69
  "vitest": "4.1.0",
72
- "vue": "^3.5.26",
73
- "@scalar/galaxy": "0.6.1"
70
+ "vue": "^3.5.30",
71
+ "@scalar/galaxy": "0.6.2"
74
72
  },
75
73
  "scripts": {
76
74
  "build": "vite build && vue-tsc -p tsconfig.build.json",