@scalar/api-reference 1.29.2 → 1.29.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/browser/standalone.js +2239 -2234
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
- package/dist/components/Content/Introduction/Introduction.vue2.js +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +62 -60
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +40 -39
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +167 -152
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as z, computed as
|
|
1
|
+
import { defineComponent as z, computed as b, createElementBlock as i, openBlock as a, createCommentVNode as n, createBlock as d, normalizeClass as H, renderSlot as D, Fragment as y, createTextVNode as l, withCtx as r, createVNode as v, toDisplayString as m, unref as N } from "vue";
|
|
2
2
|
import { isDefined as B } from "@scalar/oas-utils/helpers";
|
|
3
|
-
import { stringify as
|
|
3
|
+
import { stringify as g } from "flatted";
|
|
4
4
|
import { compositions as J } from "./helpers/schema-composition.js";
|
|
5
5
|
import R from "./SchemaPropertyExamples.vue.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
6
|
+
import j from "../../ScreenReader.vue.js";
|
|
7
|
+
import f from "./SchemaPropertyDetail.vue.js";
|
|
8
|
+
import E from "../../Badge/Badge.vue.js";
|
|
9
|
+
const W = { class: "property-heading" }, G = {
|
|
10
10
|
key: 2,
|
|
11
11
|
class: "property-additional"
|
|
12
|
-
},
|
|
12
|
+
}, K = {
|
|
13
13
|
key: 3,
|
|
14
14
|
class: "property-pattern"
|
|
15
|
-
},
|
|
15
|
+
}, Q = {
|
|
16
16
|
key: 4,
|
|
17
17
|
class: "property-deprecated"
|
|
18
|
-
},
|
|
18
|
+
}, U = {
|
|
19
19
|
key: 5,
|
|
20
20
|
class: "property-const"
|
|
21
21
|
}, X = {
|
|
@@ -38,232 +38,247 @@ const G = { class: "property-heading" }, K = {
|
|
|
38
38
|
withExamples: { type: Boolean, default: !0 },
|
|
39
39
|
schemas: {}
|
|
40
40
|
},
|
|
41
|
-
setup(
|
|
42
|
-
J.find((e) => !
|
|
43
|
-
const
|
|
41
|
+
setup(u) {
|
|
42
|
+
J.find((e) => !u.value || typeof u.value != "object" ? !1 : e in u.value || u.value.items && typeof u.value.items == "object" && e in u.value.items);
|
|
43
|
+
const L = (e) => (e == null ? void 0 : e.default) === null ? "null" : Array.isArray(e == null ? void 0 : e.default) && e.default.length === 1 ? e.default[0] : typeof (e == null ? void 0 : e.default) == "string" ? JSON.stringify(e.default) : e == null ? void 0 : e.default, M = (e) => {
|
|
44
44
|
if (!e)
|
|
45
45
|
return null;
|
|
46
46
|
if (e.title)
|
|
47
47
|
return e.title;
|
|
48
48
|
if (e.name)
|
|
49
49
|
return e.name;
|
|
50
|
-
if (
|
|
51
|
-
for (const [t,
|
|
52
|
-
if (
|
|
50
|
+
if (u.schemas && typeof u.schemas == "object") {
|
|
51
|
+
for (const [t, o] of Object.entries(u.schemas))
|
|
52
|
+
if (g(o) === g(e))
|
|
53
53
|
return t;
|
|
54
|
+
if (e.type === "object" && e.properties) {
|
|
55
|
+
for (const [t, o] of Object.entries(u.schemas))
|
|
56
|
+
if (g(o.properties) === g(e.properties))
|
|
57
|
+
return t;
|
|
58
|
+
}
|
|
54
59
|
}
|
|
55
60
|
return null;
|
|
56
|
-
},
|
|
57
|
-
var e, t,
|
|
58
|
-
if (B((e =
|
|
59
|
-
return (t =
|
|
60
|
-
if (((
|
|
61
|
-
return
|
|
62
|
-
if ((p =
|
|
63
|
-
if (B(
|
|
64
|
-
return
|
|
65
|
-
if (((k =
|
|
66
|
-
return
|
|
61
|
+
}, S = b(() => {
|
|
62
|
+
var e, t, o, s, p, k;
|
|
63
|
+
if (B((e = u.value) == null ? void 0 : e.const))
|
|
64
|
+
return (t = u.value) == null ? void 0 : t.const;
|
|
65
|
+
if (((s = (o = u.value) == null ? void 0 : o.enum) == null ? void 0 : s.length) === 1)
|
|
66
|
+
return u.value.enum[0];
|
|
67
|
+
if ((p = u.value) != null && p.items) {
|
|
68
|
+
if (B(u.value.items.const))
|
|
69
|
+
return u.value.items.const;
|
|
70
|
+
if (((k = u.value.items.enum) == null ? void 0 : k.length) === 1)
|
|
71
|
+
return u.value.items.enum[0];
|
|
67
72
|
}
|
|
68
73
|
return null;
|
|
69
|
-
}), T =
|
|
70
|
-
var e, t,
|
|
71
|
-
return Array.isArray((e =
|
|
74
|
+
}), T = b(() => {
|
|
75
|
+
var e, t, o, s;
|
|
76
|
+
return Array.isArray((e = u.value) == null ? void 0 : e.type) ? u.value.type.join(" | ") : (t = u.value) != null && t.title ? u.value.title : (o = u.value) != null && o.name ? u.value.name : ((s = u.value) == null ? void 0 : s.type) ?? "";
|
|
77
|
+
}), F = (e, t) => e === "array" ? `${e} ${t}[]` : `${e} ${t}`, $ = b(() => {
|
|
78
|
+
var t, o;
|
|
79
|
+
if (!((t = u.value) != null && t.type))
|
|
80
|
+
return null;
|
|
81
|
+
if (u.value.type === "array" && ((o = u.value.items) != null && o.type)) {
|
|
82
|
+
const s = M(u.value.items) || u.value.items.type;
|
|
83
|
+
return F(u.value.type, s);
|
|
84
|
+
}
|
|
85
|
+
const e = M(u.value);
|
|
86
|
+
return e || null;
|
|
72
87
|
});
|
|
73
88
|
return (e, t) => {
|
|
74
|
-
var
|
|
75
|
-
return
|
|
76
|
-
e.$slots.name ? (
|
|
89
|
+
var o, s, p, k, V, q, w, P, I, O, A;
|
|
90
|
+
return a(), i("div", W, [
|
|
91
|
+
e.$slots.name ? (a(), i("div", {
|
|
77
92
|
key: 0,
|
|
78
|
-
class: H(["property-name", { deprecated: (
|
|
93
|
+
class: H(["property-name", { deprecated: (o = e.value) == null ? void 0 : o.deprecated }])
|
|
79
94
|
}, [
|
|
80
|
-
e.pattern ? (
|
|
81
|
-
t[0] || (t[0] =
|
|
82
|
-
|
|
83
|
-
t[1] || (t[1] =
|
|
84
|
-
], 64)) :
|
|
85
|
-
], 2)) :
|
|
86
|
-
e.value ? (
|
|
87
|
-
(
|
|
88
|
-
default:
|
|
89
|
-
var
|
|
95
|
+
e.pattern ? (a(), i(y, { key: 1 }, [
|
|
96
|
+
t[0] || (t[0] = l("/")),
|
|
97
|
+
D(e.$slots, "name", {}, void 0, !0),
|
|
98
|
+
t[1] || (t[1] = l("/"))
|
|
99
|
+
], 64)) : D(e.$slots, "name", { key: 0 }, void 0, !0)
|
|
100
|
+
], 2)) : n("", !0),
|
|
101
|
+
e.value ? (a(), i(y, { key: 1 }, [
|
|
102
|
+
(s = e.value) != null && s.type ? (a(), d(f, { key: 0 }, {
|
|
103
|
+
default: r(() => {
|
|
104
|
+
var C;
|
|
90
105
|
return [
|
|
91
|
-
v(
|
|
92
|
-
default:
|
|
93
|
-
|
|
106
|
+
v(j, null, {
|
|
107
|
+
default: r(() => t[2] || (t[2] = [
|
|
108
|
+
l("Type:")
|
|
94
109
|
])),
|
|
95
110
|
_: 1
|
|
96
111
|
}),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
], 64)) : (
|
|
100
|
-
|
|
112
|
+
$.value ? (a(), i(y, { key: 0 }, [
|
|
113
|
+
l(m($.value), 1)
|
|
114
|
+
], 64)) : (a(), i(y, { key: 1 }, [
|
|
115
|
+
l(m(T.value) + " " + m((C = e.value) != null && C.nullable ? " | nullable" : ""), 1)
|
|
101
116
|
], 64))
|
|
102
117
|
];
|
|
103
118
|
}),
|
|
104
119
|
_: 1
|
|
105
|
-
})) :
|
|
106
|
-
e.value.minItems || e.value.maxItems ? (
|
|
107
|
-
default:
|
|
108
|
-
|
|
120
|
+
})) : n("", !0),
|
|
121
|
+
e.value.minItems || e.value.maxItems ? (a(), d(f, { key: 1 }, {
|
|
122
|
+
default: r(() => [
|
|
123
|
+
l(m(e.value.minItems) + "…" + m(e.value.maxItems), 1)
|
|
109
124
|
]),
|
|
110
125
|
_: 1
|
|
111
|
-
})) :
|
|
112
|
-
e.value.minLength ? (
|
|
113
|
-
prefix:
|
|
114
|
-
|
|
126
|
+
})) : n("", !0),
|
|
127
|
+
e.value.minLength ? (a(), d(f, { key: 2 }, {
|
|
128
|
+
prefix: r(() => t[3] || (t[3] = [
|
|
129
|
+
l("min:")
|
|
115
130
|
])),
|
|
116
|
-
default:
|
|
117
|
-
|
|
131
|
+
default: r(() => [
|
|
132
|
+
l(" " + m(e.value.minLength), 1)
|
|
118
133
|
]),
|
|
119
134
|
_: 1
|
|
120
|
-
})) :
|
|
121
|
-
e.value.maxLength ? (
|
|
122
|
-
prefix:
|
|
123
|
-
|
|
135
|
+
})) : n("", !0),
|
|
136
|
+
e.value.maxLength ? (a(), d(f, { key: 3 }, {
|
|
137
|
+
prefix: r(() => t[4] || (t[4] = [
|
|
138
|
+
l("max:")
|
|
124
139
|
])),
|
|
125
|
-
default:
|
|
126
|
-
|
|
140
|
+
default: r(() => [
|
|
141
|
+
l(" " + m(e.value.maxLength), 1)
|
|
127
142
|
]),
|
|
128
143
|
_: 1
|
|
129
|
-
})) :
|
|
130
|
-
e.value.uniqueItems ? (
|
|
131
|
-
default:
|
|
132
|
-
|
|
144
|
+
})) : n("", !0),
|
|
145
|
+
e.value.uniqueItems ? (a(), d(f, { key: 4 }, {
|
|
146
|
+
default: r(() => t[5] || (t[5] = [
|
|
147
|
+
l(" unique! ")
|
|
133
148
|
])),
|
|
134
149
|
_: 1
|
|
135
|
-
})) :
|
|
136
|
-
e.value.format ? (
|
|
137
|
-
default:
|
|
138
|
-
v(
|
|
139
|
-
default:
|
|
140
|
-
|
|
150
|
+
})) : n("", !0),
|
|
151
|
+
e.value.format ? (a(), d(f, { key: 5 }, {
|
|
152
|
+
default: r(() => [
|
|
153
|
+
v(j, null, {
|
|
154
|
+
default: r(() => t[6] || (t[6] = [
|
|
155
|
+
l("Format:")
|
|
141
156
|
])),
|
|
142
157
|
_: 1
|
|
143
158
|
}),
|
|
144
|
-
|
|
159
|
+
l(" " + m(e.value.format), 1)
|
|
145
160
|
]),
|
|
146
161
|
_: 1
|
|
147
|
-
})) :
|
|
148
|
-
e.value.minimum !== void 0 && e.value.exclusiveMinimum ? (
|
|
149
|
-
prefix:
|
|
150
|
-
|
|
162
|
+
})) : n("", !0),
|
|
163
|
+
e.value.minimum !== void 0 && e.value.exclusiveMinimum ? (a(), d(f, { key: 6 }, {
|
|
164
|
+
prefix: r(() => t[7] || (t[7] = [
|
|
165
|
+
l("greater than:")
|
|
151
166
|
])),
|
|
152
|
-
default:
|
|
153
|
-
|
|
167
|
+
default: r(() => [
|
|
168
|
+
l(" " + m(e.value.minimum), 1)
|
|
154
169
|
]),
|
|
155
170
|
_: 1
|
|
156
|
-
})) :
|
|
157
|
-
e.value.minimum !== void 0 && !e.value.exclusiveMinimum ? (
|
|
158
|
-
prefix:
|
|
159
|
-
|
|
171
|
+
})) : n("", !0),
|
|
172
|
+
e.value.minimum !== void 0 && !e.value.exclusiveMinimum ? (a(), d(f, { key: 7 }, {
|
|
173
|
+
prefix: r(() => t[8] || (t[8] = [
|
|
174
|
+
l("min:")
|
|
160
175
|
])),
|
|
161
|
-
default:
|
|
162
|
-
|
|
176
|
+
default: r(() => [
|
|
177
|
+
l(" " + m(e.value.minimum), 1)
|
|
163
178
|
]),
|
|
164
179
|
_: 1
|
|
165
|
-
})) :
|
|
166
|
-
e.value.maximum !== void 0 && e.value.exclusiveMaximum ? (
|
|
167
|
-
prefix:
|
|
168
|
-
|
|
180
|
+
})) : n("", !0),
|
|
181
|
+
e.value.maximum !== void 0 && e.value.exclusiveMaximum ? (a(), d(f, { key: 8 }, {
|
|
182
|
+
prefix: r(() => t[9] || (t[9] = [
|
|
183
|
+
l("less than:")
|
|
169
184
|
])),
|
|
170
|
-
default:
|
|
171
|
-
|
|
185
|
+
default: r(() => [
|
|
186
|
+
l(" " + m(e.value.maximum), 1)
|
|
172
187
|
]),
|
|
173
188
|
_: 1
|
|
174
|
-
})) :
|
|
175
|
-
e.value.maximum !== void 0 && !e.value.exclusiveMaximum ? (
|
|
176
|
-
prefix:
|
|
177
|
-
|
|
189
|
+
})) : n("", !0),
|
|
190
|
+
e.value.maximum !== void 0 && !e.value.exclusiveMaximum ? (a(), d(f, { key: 9 }, {
|
|
191
|
+
prefix: r(() => t[10] || (t[10] = [
|
|
192
|
+
l("max:")
|
|
178
193
|
])),
|
|
179
|
-
default:
|
|
180
|
-
|
|
194
|
+
default: r(() => [
|
|
195
|
+
l(" " + m(e.value.maximum), 1)
|
|
181
196
|
]),
|
|
182
197
|
_: 1
|
|
183
|
-
})) :
|
|
184
|
-
e.value.pattern ? (
|
|
198
|
+
})) : n("", !0),
|
|
199
|
+
e.value.pattern ? (a(), d(f, {
|
|
185
200
|
key: 10,
|
|
186
201
|
code: "",
|
|
187
202
|
truncate: ""
|
|
188
203
|
}, {
|
|
189
|
-
default:
|
|
190
|
-
v(
|
|
191
|
-
default:
|
|
192
|
-
|
|
204
|
+
default: r(() => [
|
|
205
|
+
v(j, null, {
|
|
206
|
+
default: r(() => t[11] || (t[11] = [
|
|
207
|
+
l("Pattern:")
|
|
193
208
|
])),
|
|
194
209
|
_: 1
|
|
195
210
|
}),
|
|
196
|
-
|
|
211
|
+
l(" " + m(e.value.pattern), 1)
|
|
197
212
|
]),
|
|
198
213
|
_: 1
|
|
199
|
-
})) :
|
|
200
|
-
e.$props.enum ? (
|
|
201
|
-
default:
|
|
202
|
-
|
|
214
|
+
})) : n("", !0),
|
|
215
|
+
e.$props.enum ? (a(), d(f, { key: 11 }, {
|
|
216
|
+
default: r(() => t[12] || (t[12] = [
|
|
217
|
+
l("enum")
|
|
203
218
|
])),
|
|
204
219
|
_: 1
|
|
205
|
-
})) :
|
|
206
|
-
e.value.default !== void 0 ? (
|
|
220
|
+
})) : n("", !0),
|
|
221
|
+
e.value.default !== void 0 ? (a(), d(f, {
|
|
207
222
|
key: 12,
|
|
208
223
|
truncate: ""
|
|
209
224
|
}, {
|
|
210
|
-
prefix:
|
|
211
|
-
|
|
225
|
+
prefix: r(() => t[13] || (t[13] = [
|
|
226
|
+
l("default:")
|
|
212
227
|
])),
|
|
213
|
-
default:
|
|
214
|
-
|
|
228
|
+
default: r(() => [
|
|
229
|
+
l(" " + m(L(e.value)), 1)
|
|
215
230
|
]),
|
|
216
231
|
_: 1
|
|
217
|
-
})) :
|
|
218
|
-
], 64)) :
|
|
219
|
-
e.additional ? (
|
|
220
|
-
(p = e.value) != null && p["x-additionalPropertiesName"] ? (
|
|
221
|
-
|
|
222
|
-
], 64)) : (
|
|
223
|
-
|
|
232
|
+
})) : n("", !0)
|
|
233
|
+
], 64)) : n("", !0),
|
|
234
|
+
e.additional ? (a(), i("div", G, [
|
|
235
|
+
(p = e.value) != null && p["x-additionalPropertiesName"] ? (a(), i(y, { key: 0 }, [
|
|
236
|
+
l(m(e.value["x-additionalPropertiesName"]), 1)
|
|
237
|
+
], 64)) : (a(), i(y, { key: 1 }, [
|
|
238
|
+
l("additional properties")
|
|
224
239
|
], 64))
|
|
225
|
-
])) :
|
|
226
|
-
e.pattern ? (
|
|
227
|
-
v(
|
|
228
|
-
default:
|
|
229
|
-
|
|
240
|
+
])) : n("", !0),
|
|
241
|
+
e.pattern ? (a(), i("div", K, [
|
|
242
|
+
v(N(E), null, {
|
|
243
|
+
default: r(() => t[14] || (t[14] = [
|
|
244
|
+
l("pattern")
|
|
230
245
|
])),
|
|
231
246
|
_: 1
|
|
232
247
|
})
|
|
233
|
-
])) :
|
|
234
|
-
(k = e.value) != null && k.deprecated ? (
|
|
235
|
-
v(
|
|
236
|
-
default:
|
|
237
|
-
|
|
248
|
+
])) : n("", !0),
|
|
249
|
+
(k = e.value) != null && k.deprecated ? (a(), i("div", Q, [
|
|
250
|
+
v(N(E), null, {
|
|
251
|
+
default: r(() => t[15] || (t[15] = [
|
|
252
|
+
l("deprecated")
|
|
238
253
|
])),
|
|
239
254
|
_: 1
|
|
240
255
|
})
|
|
241
|
-
])) :
|
|
242
|
-
|
|
243
|
-
v(
|
|
244
|
-
prefix:
|
|
245
|
-
|
|
256
|
+
])) : n("", !0),
|
|
257
|
+
N(B)(S.value) ? (a(), i("div", U, [
|
|
258
|
+
v(f, { truncate: "" }, {
|
|
259
|
+
prefix: r(() => t[16] || (t[16] = [
|
|
260
|
+
l("const:")
|
|
246
261
|
])),
|
|
247
|
-
default:
|
|
248
|
-
|
|
262
|
+
default: r(() => [
|
|
263
|
+
l(" " + m(S.value), 1)
|
|
249
264
|
]),
|
|
250
265
|
_: 1
|
|
251
266
|
})
|
|
252
|
-
])) : (
|
|
253
|
-
((
|
|
254
|
-
default:
|
|
255
|
-
|
|
267
|
+
])) : (a(), i(y, { key: 6 }, [
|
|
268
|
+
((V = e.value) == null ? void 0 : V.nullable) === !0 ? (a(), d(f, { key: 0 }, {
|
|
269
|
+
default: r(() => t[17] || (t[17] = [
|
|
270
|
+
l(" nullable ")
|
|
256
271
|
])),
|
|
257
272
|
_: 1
|
|
258
|
-
})) :
|
|
273
|
+
})) : n("", !0)
|
|
259
274
|
], 64)),
|
|
260
|
-
(q = e.value) != null && q.writeOnly ? (
|
|
261
|
-
e.required ? (
|
|
262
|
-
e.withExamples ? (
|
|
275
|
+
(q = e.value) != null && q.writeOnly ? (a(), i("div", X, " write-only ")) : (w = e.value) != null && w.readOnly ? (a(), i("div", Y, " read-only ")) : n("", !0),
|
|
276
|
+
e.required ? (a(), i("div", Z, " required ")) : n("", !0),
|
|
277
|
+
e.withExamples ? (a(), d(R, {
|
|
263
278
|
key: 10,
|
|
264
279
|
examples: (P = e.value) == null ? void 0 : P.examples,
|
|
265
|
-
example: ((
|
|
266
|
-
}, null, 8, ["examples", "example"])) :
|
|
280
|
+
example: ((I = e.value) == null ? void 0 : I.example) || ((A = (O = e.value) == null ? void 0 : O.items) == null ? void 0 : A.example)
|
|
281
|
+
}, null, 8, ["examples", "example"])) : n("", !0)
|
|
267
282
|
]);
|
|
268
283
|
};
|
|
269
284
|
}
|