docusaurus-plugin-openapi-docs 0.0.0-348 → 0.0.0-351

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/lib/index.d.ts +3 -0
  2. package/lib/index.js +194 -0
  3. package/lib/markdown/createContactInfo.d.ts +2 -0
  4. package/lib/markdown/createContactInfo.js +49 -0
  5. package/lib/markdown/createDeprecationNotice.d.ts +6 -0
  6. package/lib/markdown/createDeprecationNotice.js +19 -0
  7. package/lib/markdown/createDescription.d.ts +1 -0
  8. package/lib/markdown/createDescription.js +16 -0
  9. package/lib/markdown/createDetails.d.ts +2 -0
  10. package/lib/markdown/createDetails.js +18 -0
  11. package/lib/markdown/createDetailsSummary.d.ts +2 -0
  12. package/lib/markdown/createDetailsSummary.js +18 -0
  13. package/lib/markdown/createLicense.d.ts +2 -0
  14. package/lib/markdown/createLicense.js +33 -0
  15. package/lib/markdown/createParamsDetails.d.ts +7 -0
  16. package/lib/markdown/createParamsDetails.js +44 -0
  17. package/lib/markdown/createRequestBodyDetails.d.ts +6 -0
  18. package/lib/markdown/createRequestBodyDetails.js +14 -0
  19. package/lib/markdown/createSchemaDetails.d.ts +14 -0
  20. package/lib/markdown/createSchemaDetails.js +244 -0
  21. package/lib/markdown/createStatusCodes.d.ts +6 -0
  22. package/lib/markdown/createStatusCodes.js +47 -0
  23. package/lib/markdown/createTermsOfService.d.ts +1 -0
  24. package/lib/markdown/createTermsOfService.js +32 -0
  25. package/lib/markdown/createVersionBadge.d.ts +1 -0
  26. package/lib/markdown/createVersionBadge.js +20 -0
  27. package/lib/markdown/index.d.ts +3 -0
  28. package/lib/markdown/index.js +49 -0
  29. package/lib/markdown/schema.d.ts +3 -0
  30. package/lib/markdown/schema.js +100 -0
  31. package/lib/markdown/schema.test.d.ts +1 -0
  32. package/lib/markdown/schema.test.js +171 -0
  33. package/lib/markdown/utils.d.ts +7 -0
  34. package/lib/markdown/utils.js +33 -0
  35. package/lib/openapi/createExample.d.ts +2 -0
  36. package/lib/openapi/createExample.js +113 -0
  37. package/lib/openapi/index.d.ts +1 -0
  38. package/lib/openapi/index.js +12 -0
  39. package/lib/openapi/openapi.d.ts +11 -0
  40. package/lib/openapi/openapi.js +231 -0
  41. package/lib/openapi/openapi.test.d.ts +1 -0
  42. package/lib/openapi/openapi.test.js +33 -0
  43. package/lib/openapi/types.d.ts +334 -0
  44. package/{src/markdown/createRequestBodyTable.ts → lib/openapi/types.js} +2 -11
  45. package/lib/options.d.ts +4 -0
  46. package/lib/options.js +18 -0
  47. package/lib/sidebars/index.d.ts +3 -0
  48. package/lib/sidebars/index.js +89 -0
  49. package/lib/types.d.ts +68 -0
  50. package/{src/markdown/createFullWidthTable.ts → lib/types.js} +2 -10
  51. package/package.json +2 -2
  52. package/src/markdown/createContactInfo.ts +48 -0
  53. package/src/markdown/createLicense.ts +32 -0
  54. package/src/markdown/createTermsOfService.ts +30 -0
  55. package/src/markdown/index.ts +8 -1
  56. package/src/openapi/types.ts +2 -0
  57. package/src/markdown/createParamsTable.ts +0 -102
  58. package/src/markdown/createSchemaTable.ts +0 -275
@@ -0,0 +1,244 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.createSchemaDetails = void 0;
10
+ const createDescription_1 = require("./createDescription");
11
+ const createDetails_1 = require("./createDetails");
12
+ const createDetailsSummary_1 = require("./createDetailsSummary");
13
+ const schema_1 = require("./schema");
14
+ const utils_1 = require("./utils");
15
+ const mergeAllOf = require("json-schema-merge-allof");
16
+ function resolveAllOf(allOf) {
17
+ // Use external library to resolve and merge nested allOf schemas
18
+ let properties = {};
19
+ const mergedSchemas = mergeAllOf(allOf, {
20
+ resolvers: {
21
+ readOnly: function () {
22
+ return true;
23
+ },
24
+ example: function () {
25
+ return true;
26
+ },
27
+ },
28
+ });
29
+ if (mergedSchemas.properties) {
30
+ properties = mergedSchemas.properties;
31
+ }
32
+ const required = allOf.reduce((acc, cur) => {
33
+ if (Array.isArray(cur.required)) {
34
+ const next = [...acc, ...cur.required];
35
+ return next;
36
+ }
37
+ return acc;
38
+ }, []);
39
+ return { properties, required };
40
+ }
41
+ function createRow({ name, schema, required }) {
42
+ const schemaName = (0, schema_1.getSchemaName)(schema, true);
43
+ if (schemaName && (schemaName === "object" || schemaName === "object[]")) {
44
+ return (0, utils_1.create)("SchemaItem", {
45
+ collapsible: true,
46
+ className: "schemaItem",
47
+ children: [
48
+ (0, createDetails_1.createDetails)({
49
+ children: [
50
+ (0, createDetailsSummary_1.createDetailsSummary)({
51
+ children: [
52
+ (0, utils_1.create)("strong", { children: name }),
53
+ (0, utils_1.create)("span", {
54
+ style: { opacity: "0.6" },
55
+ children: ` ${schemaName}`,
56
+ }),
57
+ (0, utils_1.guard)(required, () => [
58
+ (0, utils_1.create)("strong", {
59
+ style: {
60
+ fontSize: "var(--ifm-code-font-size)",
61
+ color: "var(--openapi-required)",
62
+ },
63
+ children: " required",
64
+ }),
65
+ ]),
66
+ ],
67
+ }),
68
+ (0, utils_1.create)("div", {
69
+ style: { marginLeft: "1rem" },
70
+ children: [
71
+ (0, utils_1.guard)((0, schema_1.getQualifierMessage)(schema), (message) => (0, utils_1.create)("div", {
72
+ style: { marginTop: ".5rem", marginBottom: ".5rem" },
73
+ children: (0, createDescription_1.createDescription)(message),
74
+ })),
75
+ (0, utils_1.guard)(schema.description, (description) => (0, utils_1.create)("div", {
76
+ style: { marginTop: ".5rem", marginBottom: ".5rem" },
77
+ children: (0, createDescription_1.createDescription)(description),
78
+ })),
79
+ createRows({ schema: schema }),
80
+ ],
81
+ }),
82
+ ],
83
+ }),
84
+ ],
85
+ });
86
+ }
87
+ return (0, utils_1.create)("SchemaItem", {
88
+ collapsible: false,
89
+ name,
90
+ required,
91
+ schemaDescription: schema.description,
92
+ schemaName: (0, schema_1.getSchemaName)(schema, true),
93
+ qualifierMessage: (0, schema_1.getQualifierMessage)(schema),
94
+ });
95
+ }
96
+ function createRows({ schema }) {
97
+ // object
98
+ if (schema.properties !== undefined) {
99
+ return (0, utils_1.create)("ul", {
100
+ children: Object.entries(schema.properties).map(([key, val]) => createRow({
101
+ name: key,
102
+ schema: val,
103
+ required: Array.isArray(schema.required)
104
+ ? schema.required.includes(key)
105
+ : false,
106
+ })),
107
+ });
108
+ }
109
+ // TODO: This can be a bit complicated types can be missmatched and there can be nested allOfs which need to be resolved before merging properties
110
+ if (schema.allOf !== undefined) {
111
+ const { properties, required } = resolveAllOf(schema.allOf);
112
+ return (0, utils_1.create)("div", {
113
+ children: [
114
+ (0, utils_1.create)("span", {
115
+ className: "badge badge--info",
116
+ style: { marginBottom: "1rem" },
117
+ children: "allOf",
118
+ }),
119
+ (0, utils_1.create)("ul", {
120
+ className: "allOf",
121
+ children: Object.entries(properties).map(([key, val]) => createRow({
122
+ name: key,
123
+ schema: val,
124
+ required: Array.isArray(required)
125
+ ? required.includes(key)
126
+ : false,
127
+ })),
128
+ }),
129
+ ],
130
+ });
131
+ }
132
+ // array
133
+ if (schema.items !== undefined) {
134
+ return createRows({ schema: schema.items });
135
+ }
136
+ // primitive
137
+ return undefined;
138
+ }
139
+ function createRowsRoot({ schema }) {
140
+ // object
141
+ if (schema.properties !== undefined) {
142
+ return Object.entries(schema.properties).map(([key, val]) => createRow({
143
+ name: key,
144
+ schema: val,
145
+ required: Array.isArray(schema.required)
146
+ ? schema.required.includes(key)
147
+ : false,
148
+ }));
149
+ }
150
+ // TODO: This can be a bit complicated types can be missmatched and there can be nested allOfs which need to be resolved before merging properties
151
+ if (schema.allOf !== undefined) {
152
+ const { properties, required } = resolveAllOf(schema.allOf);
153
+ return Object.entries(properties).map(([key, val]) => createRow({
154
+ name: key,
155
+ schema: val,
156
+ required: Array.isArray(required) ? required.includes(key) : false,
157
+ }));
158
+ }
159
+ // array
160
+ if (schema.items !== undefined) {
161
+ return (0, utils_1.create)("li", {
162
+ children: (0, utils_1.create)("div", {
163
+ children: [createRows({ schema: schema.items })],
164
+ }),
165
+ });
166
+ }
167
+ // primitive
168
+ return (0, utils_1.create)("li", {
169
+ children: (0, utils_1.create)("div", {
170
+ children: [
171
+ (0, utils_1.create)("span", {
172
+ style: { opacity: "0.6" },
173
+ children: ` ${schema.type}`,
174
+ }),
175
+ (0, utils_1.guard)((0, schema_1.getQualifierMessage)(schema), (message) => (0, utils_1.create)("div", {
176
+ style: { marginTop: "var(--ifm-table-cell-padding)" },
177
+ children: (0, createDescription_1.createDescription)(message),
178
+ })),
179
+ (0, utils_1.guard)(schema.description, (description) => (0, utils_1.create)("div", {
180
+ style: { marginTop: "var(--ifm-table-cell-padding)" },
181
+ children: (0, createDescription_1.createDescription)(description),
182
+ })),
183
+ ],
184
+ }),
185
+ });
186
+ }
187
+ function createSchemaDetails({ title, body, ...rest }) {
188
+ if (body === undefined ||
189
+ body.content === undefined ||
190
+ Object.keys(body).length === 0 ||
191
+ Object.keys(body.content).length === 0) {
192
+ return undefined;
193
+ }
194
+ // TODO:
195
+ // NOTE: We just pick a random content-type.
196
+ // How common is it to have multiple?
197
+ const randomFirstKey = Object.keys(body.content)[0];
198
+ const firstBody = body.content[randomFirstKey].schema;
199
+ if (firstBody === undefined) {
200
+ return undefined;
201
+ }
202
+ // we don't show the table if there is no properties to show
203
+ if (firstBody.properties !== undefined) {
204
+ if (Object.keys(firstBody.properties).length === 0) {
205
+ return undefined;
206
+ }
207
+ }
208
+ return (0, createDetails_1.createDetails)({
209
+ ...rest,
210
+ children: [
211
+ (0, createDetailsSummary_1.createDetailsSummary)({
212
+ style: { textAlign: "left" },
213
+ children: [
214
+ (0, utils_1.create)("strong", { children: `${title}` }),
215
+ (0, utils_1.guard)(body.required, () => [
216
+ (0, utils_1.create)("strong", {
217
+ style: {
218
+ fontSize: "var(--ifm-code-font-size)",
219
+ color: "var(--openapi-required)",
220
+ },
221
+ children: " required",
222
+ }),
223
+ ]),
224
+ ],
225
+ }),
226
+ (0, utils_1.create)("div", {
227
+ style: { textAlign: "left", marginLeft: "1rem" },
228
+ children: [
229
+ (0, utils_1.guard)(body.description, () => [
230
+ (0, utils_1.create)("div", {
231
+ style: { marginTop: "1rem", marginBottom: "1rem" },
232
+ children: (0, createDescription_1.createDescription)(body.description),
233
+ }),
234
+ ]),
235
+ ],
236
+ }),
237
+ (0, utils_1.create)("ul", {
238
+ style: { marginLeft: "1rem" },
239
+ children: createRowsRoot({ schema: firstBody }),
240
+ }),
241
+ ],
242
+ });
243
+ }
244
+ exports.createSchemaDetails = createSchemaDetails;
@@ -0,0 +1,6 @@
1
+ import { ApiItem } from "../types";
2
+ interface Props {
3
+ responses: ApiItem["responses"];
4
+ }
5
+ export declare function createStatusCodes({ responses }: Props): string | undefined;
6
+ export {};
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.createStatusCodes = void 0;
10
+ const createDescription_1 = require("./createDescription");
11
+ const createSchemaDetails_1 = require("./createSchemaDetails");
12
+ const utils_1 = require("./utils");
13
+ function createStatusCodes({ responses }) {
14
+ if (responses === undefined) {
15
+ return undefined;
16
+ }
17
+ const codes = Object.keys(responses);
18
+ if (codes.length === 0) {
19
+ return undefined;
20
+ }
21
+ return (0, utils_1.create)("div", {
22
+ children: [
23
+ (0, utils_1.create)("ApiTabs", {
24
+ children: codes.map((code) => {
25
+ return (0, utils_1.create)("TabItem", {
26
+ label: code,
27
+ value: code,
28
+ children: [
29
+ (0, utils_1.create)("div", {
30
+ children: (0, createDescription_1.createDescription)(responses[code].description),
31
+ }),
32
+ (0, utils_1.create)("div", {
33
+ children: (0, createSchemaDetails_1.createSchemaDetails)({
34
+ title: "Schema",
35
+ body: {
36
+ content: responses[code].content,
37
+ },
38
+ }),
39
+ }),
40
+ ],
41
+ });
42
+ }),
43
+ }),
44
+ ],
45
+ });
46
+ }
47
+ exports.createStatusCodes = createStatusCodes;
@@ -0,0 +1 @@
1
+ export declare function createTermsOfService(termsOfService: string | undefined): string;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.createTermsOfService = void 0;
10
+ const utils_1 = require("./utils");
11
+ function createTermsOfService(termsOfService) {
12
+ if (!createTermsOfService)
13
+ return "";
14
+ return (0, utils_1.create)("div", {
15
+ style: {
16
+ marginBottom: "var(--ifm-paragraph-margin-bottom)",
17
+ },
18
+ children: [
19
+ (0, utils_1.create)("h3", {
20
+ style: {
21
+ marginBottom: "0.25rem",
22
+ },
23
+ children: "Terms of Service",
24
+ }),
25
+ (0, utils_1.create)("a", {
26
+ href: `${termsOfService}`,
27
+ children: termsOfService,
28
+ }),
29
+ ],
30
+ });
31
+ }
32
+ exports.createTermsOfService = createTermsOfService;
@@ -0,0 +1 @@
1
+ export declare function createVersionBadge(version: string | undefined): string;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.createVersionBadge = void 0;
10
+ const utils_1 = require("./utils");
11
+ function createVersionBadge(version) {
12
+ return (0, utils_1.guard)(version, (version) => [
13
+ (0, utils_1.create)("span", {
14
+ className: "theme-doc-version-badge badge badge--secondary",
15
+ children: `Version: ${escape(version)}`,
16
+ }),
17
+ `\n\n`,
18
+ ]);
19
+ }
20
+ exports.createVersionBadge = createVersionBadge;
@@ -0,0 +1,3 @@
1
+ import { ApiPageMetadata, InfoPageMetadata } from "../types";
2
+ export declare function createApiPageMD({ title, api: { deprecated, "x-deprecated-description": deprecatedDescription, description, parameters, requestBody, responses, }, }: ApiPageMetadata): string;
3
+ export declare function createInfoPageMD({ info: { title, version, description, contact, license, termsOfService }, }: InfoPageMetadata): string;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.createInfoPageMD = exports.createApiPageMD = void 0;
10
+ const lodash_1 = require("lodash");
11
+ const createContactInfo_1 = require("./createContactInfo");
12
+ const createDeprecationNotice_1 = require("./createDeprecationNotice");
13
+ const createDescription_1 = require("./createDescription");
14
+ const createLicense_1 = require("./createLicense");
15
+ const createParamsDetails_1 = require("./createParamsDetails");
16
+ const createRequestBodyDetails_1 = require("./createRequestBodyDetails");
17
+ const createStatusCodes_1 = require("./createStatusCodes");
18
+ const createTermsOfService_1 = require("./createTermsOfService");
19
+ const createVersionBadge_1 = require("./createVersionBadge");
20
+ const utils_1 = require("./utils");
21
+ function createApiPageMD({ title, api: { deprecated, "x-deprecated-description": deprecatedDescription, description, parameters, requestBody, responses, }, }) {
22
+ return (0, utils_1.render)([
23
+ `import ParamsItem from "@theme/ParamsItem";\n`,
24
+ `import SchemaItem from "@theme/SchemaItem"\n`,
25
+ `import ApiTabs from "@theme/ApiTabs";\n`,
26
+ `import TabItem from "@theme/TabItem";\n\n`,
27
+ `## ${(0, lodash_1.escape)(title)}\n\n`,
28
+ (0, createDeprecationNotice_1.createDeprecationNotice)({ deprecated, description: deprecatedDescription }),
29
+ (0, createDescription_1.createDescription)((0, lodash_1.escape)(description)),
30
+ (0, createParamsDetails_1.createParamsDetails)({ parameters, type: "path" }),
31
+ (0, createParamsDetails_1.createParamsDetails)({ parameters, type: "query" }),
32
+ (0, createParamsDetails_1.createParamsDetails)({ parameters, type: "header" }),
33
+ (0, createParamsDetails_1.createParamsDetails)({ parameters, type: "cookie" }),
34
+ (0, createRequestBodyDetails_1.createRequestBodyDetails)({ title: "Request Body", body: requestBody }),
35
+ (0, createStatusCodes_1.createStatusCodes)({ responses }),
36
+ ]);
37
+ }
38
+ exports.createApiPageMD = createApiPageMD;
39
+ function createInfoPageMD({ info: { title, version, description, contact, license, termsOfService }, }) {
40
+ return (0, utils_1.render)([
41
+ (0, createVersionBadge_1.createVersionBadge)(version),
42
+ `# ${(0, lodash_1.escape)(title)}\n\n`,
43
+ (0, createDescription_1.createDescription)(description),
44
+ (0, createContactInfo_1.createContactInfo)(contact),
45
+ (0, createTermsOfService_1.createTermsOfService)(termsOfService),
46
+ (0, createLicense_1.createLicense)(license),
47
+ ]);
48
+ }
49
+ exports.createInfoPageMD = createInfoPageMD;
@@ -0,0 +1,3 @@
1
+ import { SchemaObject } from "../openapi/types";
2
+ export declare function getSchemaName(schema: SchemaObject, circular?: boolean): string;
3
+ export declare function getQualifierMessage(schema?: SchemaObject): string | undefined;
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.getQualifierMessage = exports.getSchemaName = void 0;
10
+ function prettyName(schema, circular) {
11
+ var _a, _b, _c;
12
+ if (schema.$ref) {
13
+ return schema.$ref.replace("#/components/schemas/", "") + circular
14
+ ? " (circular)"
15
+ : "";
16
+ }
17
+ if (schema.format) {
18
+ return schema.format;
19
+ }
20
+ if (schema.allOf) {
21
+ return "object";
22
+ }
23
+ if (schema.type === "object") {
24
+ return (_b = (_a = schema.xml) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : schema.type;
25
+ }
26
+ return (_c = schema.title) !== null && _c !== void 0 ? _c : schema.type;
27
+ }
28
+ function getSchemaName(schema, circular) {
29
+ var _a;
30
+ if (schema.items) {
31
+ return prettyName(schema.items, circular) + "[]";
32
+ }
33
+ return (_a = prettyName(schema, circular)) !== null && _a !== void 0 ? _a : "";
34
+ }
35
+ exports.getSchemaName = getSchemaName;
36
+ function getQualifierMessage(schema) {
37
+ // TODO:
38
+ // - maxItems
39
+ // - minItems
40
+ // - uniqueItems
41
+ // - maxProperties
42
+ // - minProperties
43
+ // - multipleOf
44
+ if (!schema) {
45
+ return undefined;
46
+ }
47
+ if (schema.items) {
48
+ return getQualifierMessage(schema.items);
49
+ }
50
+ let message = "**Possible values:** ";
51
+ let qualifierGroups = [];
52
+ if (schema.minLength || schema.maxLength) {
53
+ let lengthQualifier = "";
54
+ if (schema.minLength) {
55
+ lengthQualifier += `${schema.minLength} ≤ `;
56
+ }
57
+ lengthQualifier += "length";
58
+ if (schema.maxLength) {
59
+ lengthQualifier += ` ≤ ${schema.maxLength}`;
60
+ }
61
+ qualifierGroups.push(lengthQualifier);
62
+ }
63
+ if (schema.minimum ||
64
+ schema.maximum ||
65
+ typeof schema.exclusiveMinimum === "number" ||
66
+ typeof schema.exclusiveMaximum === "number") {
67
+ let minmaxQualifier = "";
68
+ if (typeof schema.exclusiveMinimum === "number") {
69
+ minmaxQualifier += `${schema.exclusiveMinimum} < `;
70
+ }
71
+ else if (schema.minimum && !schema.exclusiveMinimum) {
72
+ minmaxQualifier += `${schema.minimum} ≤ `;
73
+ }
74
+ else if (schema.minimum && schema.exclusiveMinimum === true) {
75
+ minmaxQualifier += `${schema.minimum} < `;
76
+ }
77
+ minmaxQualifier += "value";
78
+ if (typeof schema.exclusiveMaximum === "number") {
79
+ minmaxQualifier += ` < ${schema.exclusiveMaximum}`;
80
+ }
81
+ else if (schema.maximum && !schema.exclusiveMaximum) {
82
+ minmaxQualifier += ` ≤ ${schema.maximum}`;
83
+ }
84
+ else if (schema.maximum && schema.exclusiveMaximum === true) {
85
+ minmaxQualifier += ` < ${schema.maximum}`;
86
+ }
87
+ qualifierGroups.push(minmaxQualifier);
88
+ }
89
+ if (schema.pattern) {
90
+ qualifierGroups.push(`Value must match regular expression \`${schema.pattern}\``);
91
+ }
92
+ if (schema.enum) {
93
+ qualifierGroups.push(`[${schema.enum.map((e) => `\`${e}\``).join(", ")}]`);
94
+ }
95
+ if (qualifierGroups.length === 0) {
96
+ return undefined;
97
+ }
98
+ return message + qualifierGroups.join(", ");
99
+ }
100
+ exports.getQualifierMessage = getQualifierMessage;
@@ -0,0 +1 @@
1
+ export {};