@mintlify/validation 0.1.28 → 0.1.30
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/dist/types/endpoint.d.ts
CHANGED
|
@@ -63,16 +63,15 @@ export type ResponseSchema = {
|
|
|
63
63
|
[code: string]: BodySchema;
|
|
64
64
|
};
|
|
65
65
|
export type DataSchemaArray = [DataSchema, ...DataSchema[]];
|
|
66
|
-
export declare const typeList: readonly ["boolean", "string", "number", "integer", "object", "array", "stringEnum", "numberEnum", "integerEnum"];
|
|
66
|
+
export declare const typeList: readonly ["boolean", "string", "number", "integer", "object", "array", "stringEnum", "numberEnum", "integerEnum", "null"];
|
|
67
67
|
export type SchemaType = typeof typeList[number];
|
|
68
|
-
export type DataSchema = BooleanSchema | StringSchema | NumberSchema | ObjectSchema | ArraySchema | StringEnumSchema | NumberEnumSchema;
|
|
68
|
+
export type DataSchema = BooleanSchema | StringSchema | NumberSchema | ObjectSchema | ArraySchema | StringEnumSchema | NumberEnumSchema | NullSchema;
|
|
69
69
|
export type BaseSchema<T> = {
|
|
70
70
|
type: SchemaType;
|
|
71
71
|
title?: string;
|
|
72
72
|
description?: string;
|
|
73
73
|
default?: T;
|
|
74
74
|
example?: T;
|
|
75
|
-
nullable?: boolean;
|
|
76
75
|
required?: boolean;
|
|
77
76
|
readOnly?: boolean;
|
|
78
77
|
writeOnly?: boolean;
|
|
@@ -120,4 +119,7 @@ export type NumberEnumSchema = {
|
|
|
120
119
|
type: 'numberEnum' | 'integerEnum';
|
|
121
120
|
enum: number[];
|
|
122
121
|
} & BaseSchema<number>;
|
|
122
|
+
export type NullSchema = {
|
|
123
|
+
type: 'null';
|
|
124
|
+
} & BaseSchema<null>;
|
|
123
125
|
export {};
|
|
@@ -1,34 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenAPIV3_1 } from 'openapi-types';
|
|
2
2
|
import type { BodySchema, DataSchemaArray, Endpoint, HttpMethod, ParameterSections, ResponseSchema, SecurityOption, Server } from '../types/endpoint';
|
|
3
|
-
|
|
3
|
+
export declare class InvalidSchemaError extends Error {
|
|
4
|
+
constructor(message?: string);
|
|
5
|
+
}
|
|
6
|
+
export declare class ImpossibleSchemaError extends Error {
|
|
7
|
+
constructor(message?: string);
|
|
8
|
+
}
|
|
9
|
+
export declare class ConversionError extends Error {
|
|
10
|
+
constructor(message?: string);
|
|
11
|
+
}
|
|
12
|
+
type ConvertServersParams = OpenAPIV3_1.ServerObject[] | undefined;
|
|
4
13
|
type ConvertServersType = Server[] | undefined;
|
|
5
14
|
export declare const convertServers: (servers: ConvertServersParams) => ConvertServersType;
|
|
6
15
|
type ConvertParametersParams = {
|
|
7
|
-
pathParameters?:
|
|
8
|
-
operationParameters?:
|
|
16
|
+
pathParameters?: OpenAPIV3_1.ParameterObject[];
|
|
17
|
+
operationParameters?: OpenAPIV3_1.ParameterObject[];
|
|
9
18
|
};
|
|
10
19
|
export declare const convertParameters: ({ pathParameters, operationParameters, }: ConvertParametersParams) => ParameterSections;
|
|
11
|
-
export declare const convertSchema: (schema?:
|
|
12
|
-
export declare const combineTopLevelSchemas: (schema1:
|
|
20
|
+
export declare const convertSchema: (schema?: OpenAPIV3_1.SchemaObject, required?: boolean) => DataSchemaArray;
|
|
21
|
+
export declare const combineTopLevelSchemas: (schema1: OpenAPIV3_1.SchemaObject, schema2: OpenAPIV3_1.SchemaObject) => OpenAPIV3_1.SchemaObject;
|
|
13
22
|
export declare const convertProperties: (properties?: {
|
|
14
|
-
[key: string]:
|
|
23
|
+
[key: string]: OpenAPIV3_1.SchemaObject;
|
|
15
24
|
} | undefined, required?: string[]) => {
|
|
16
25
|
[key: string]: DataSchemaArray;
|
|
17
26
|
};
|
|
18
27
|
type ConvertSecurityParams = {
|
|
19
|
-
securityRequirements?:
|
|
20
|
-
securitySchemes:
|
|
28
|
+
securityRequirements?: OpenAPIV3_1.SecurityRequirementObject[];
|
|
29
|
+
securitySchemes: OpenAPIV3_1.ComponentsObject['securitySchemes'];
|
|
21
30
|
};
|
|
22
31
|
export declare const convertSecurity: ({ securityRequirements, securitySchemes, }: ConvertSecurityParams) => SecurityOption[];
|
|
23
32
|
type AddSecurityParametersParams = {
|
|
24
|
-
securityScheme:
|
|
33
|
+
securityScheme: OpenAPIV3_1.SecuritySchemeObject;
|
|
25
34
|
parameterSections: SecurityOption;
|
|
26
35
|
};
|
|
27
36
|
export declare const addSecurityParameters: ({ securityScheme, parameterSections, }: AddSecurityParametersParams) => void;
|
|
28
|
-
export declare const convertBody: (body?:
|
|
29
|
-
export declare const convertResponses: (responses:
|
|
30
|
-
export declare const convertResponse: (response:
|
|
37
|
+
export declare const convertBody: (body?: OpenAPIV3_1.RequestBodyObject) => BodySchema;
|
|
38
|
+
export declare const convertResponses: (responses: OpenAPIV3_1.ResponsesObject) => ResponseSchema;
|
|
39
|
+
export declare const convertResponse: (response: OpenAPIV3_1.ResponseObject) => {
|
|
31
40
|
[contentType: string]: DataSchemaArray;
|
|
32
41
|
};
|
|
33
|
-
export declare const
|
|
42
|
+
export declare const convertOpenAPIV3_1ToEndpoint: (spec: OpenAPIV3_1.Document, path: string, method: HttpMethod) => Endpoint | undefined;
|
|
34
43
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/validation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "Validates mint.json files",
|
|
5
5
|
"author": "Mintlify, Inc.",
|
|
6
6
|
"repository": {
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"webpack": "^5.75.0",
|
|
69
69
|
"webpack-cli": "^5.0.1"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "b2f4e34e541548cf59d7280d790dd93e000a8e44"
|
|
72
72
|
}
|