@scalar/openapi-types 0.2.0 → 0.2.2
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 +12 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +7 -0
- package/dist/openapi-types.js +28 -33
- package/dist/openapi-types.js.map +7 -0
- package/dist/openapi-types.test-d.js +52 -0
- package/dist/openapi-types.test-d.js.map +7 -0
- package/dist/schemas/3.1/compliance/callback-object.test.js +97 -0
- package/dist/schemas/3.1/compliance/callback-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/contact-object.test.js +19 -0
- package/dist/schemas/3.1/compliance/contact-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/example-object.test.js +91 -0
- package/dist/schemas/3.1/compliance/example-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/external-documentation-object.test.js +17 -0
- package/dist/schemas/3.1/compliance/external-documentation-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/header-object.test.js +47 -0
- package/dist/schemas/3.1/compliance/header-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/info-object.test.js +41 -0
- package/dist/schemas/3.1/compliance/info-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/license-object.test.js +17 -0
- package/dist/schemas/3.1/compliance/license-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/media-type-object.test.js +69 -0
- package/dist/schemas/3.1/compliance/media-type-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/openapi-object.test.js +381 -0
- package/dist/schemas/3.1/compliance/openapi-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/operation-object.test.js +467 -0
- package/dist/schemas/3.1/compliance/operation-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/parameter-object.test.js +155 -0
- package/dist/schemas/3.1/compliance/parameter-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/path-item-object.test.js +103 -0
- package/dist/schemas/3.1/compliance/path-item-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/reference-object.test.js +282 -0
- package/dist/schemas/3.1/compliance/reference-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/request-body-object.test.js +97 -0
- package/dist/schemas/3.1/compliance/request-body-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/response-object.test.js +131 -0
- package/dist/schemas/3.1/compliance/response-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/responses-object.test.js +53 -0
- package/dist/schemas/3.1/compliance/responses-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/runtime-expression.test.js +165 -0
- package/dist/schemas/3.1/compliance/runtime-expression.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/schema-object.test.js +470 -0
- package/dist/schemas/3.1/compliance/schema-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/security-requirement-object.test.js +54 -0
- package/dist/schemas/3.1/compliance/security-requirement-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/security-scheme-object.test.js +123 -0
- package/dist/schemas/3.1/compliance/security-scheme-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/server-object.test.js +17 -0
- package/dist/schemas/3.1/compliance/server-object.test.js.map +7 -0
- package/dist/schemas/3.1/compliance/tag-object.test.js +17 -0
- package/dist/schemas/3.1/compliance/tag-object.test.js.map +7 -0
- package/dist/schemas/3.1/processed/base-path-item-object.js +27 -33
- package/dist/schemas/3.1/processed/base-path-item-object.js.map +7 -0
- package/dist/schemas/3.1/processed/callback-object.js +7 -16
- package/dist/schemas/3.1/processed/callback-object.js.map +7 -0
- package/dist/schemas/3.1/processed/components-object.js +55 -62
- package/dist/schemas/3.1/processed/components-object.js.map +7 -0
- package/dist/schemas/3.1/processed/contact-object.js +11 -17
- package/dist/schemas/3.1/processed/contact-object.js.map +7 -0
- package/dist/schemas/3.1/processed/discriminator-object.js +15 -26
- package/dist/schemas/3.1/processed/discriminator-object.js.map +7 -0
- package/dist/schemas/3.1/processed/encoding-object.js +17 -28
- package/dist/schemas/3.1/processed/encoding-object.js.map +7 -0
- package/dist/schemas/3.1/processed/example-object.js +23 -33
- package/dist/schemas/3.1/processed/example-object.js.map +7 -0
- package/dist/schemas/3.1/processed/external-documentation-object.js +9 -15
- package/dist/schemas/3.1/processed/external-documentation-object.js.map +7 -0
- package/dist/schemas/3.1/processed/header-object.js +48 -64
- package/dist/schemas/3.1/processed/header-object.js.map +7 -0
- package/dist/schemas/3.1/processed/index.js +87 -30
- package/dist/schemas/3.1/processed/index.js.map +7 -0
- package/dist/schemas/3.1/processed/info-object.js +36 -43
- package/dist/schemas/3.1/processed/info-object.js.map +7 -0
- package/dist/schemas/3.1/processed/license-object.js +13 -19
- package/dist/schemas/3.1/processed/license-object.js.map +7 -0
- package/dist/schemas/3.1/processed/link-object.js +36 -50
- package/dist/schemas/3.1/processed/link-object.js.map +7 -0
- package/dist/schemas/3.1/processed/media-type-object-without-encoding.js +26 -32
- package/dist/schemas/3.1/processed/media-type-object-without-encoding.js.map +7 -0
- package/dist/schemas/3.1/processed/media-type-object.js +30 -36
- package/dist/schemas/3.1/processed/media-type-object.js.map +7 -0
- package/dist/schemas/3.1/processed/openapi-object.js +70 -78
- package/dist/schemas/3.1/processed/openapi-object.js.map +7 -0
- package/dist/schemas/3.1/processed/operation-object-without-callbacks.js +64 -70
- package/dist/schemas/3.1/processed/operation-object-without-callbacks.js.map +7 -0
- package/dist/schemas/3.1/processed/operation-object.js +14 -20
- package/dist/schemas/3.1/processed/operation-object.js.map +7 -0
- package/dist/schemas/3.1/processed/parameter-object.js +83 -91
- package/dist/schemas/3.1/processed/parameter-object.js.map +7 -0
- package/dist/schemas/3.1/processed/path-item-object-without-callbacks.js +38 -46
- package/dist/schemas/3.1/processed/path-item-object-without-callbacks.js.map +7 -0
- package/dist/schemas/3.1/processed/path-item-object.js +38 -46
- package/dist/schemas/3.1/processed/path-item-object.js.map +7 -0
- package/dist/schemas/3.1/processed/paths-object.js +16 -22
- package/dist/schemas/3.1/processed/paths-object.js.map +7 -0
- package/dist/schemas/3.1/processed/request-body-object.js +25 -31
- package/dist/schemas/3.1/processed/request-body-object.js.map +7 -0
- package/dist/schemas/3.1/processed/response-object.js +28 -34
- package/dist/schemas/3.1/processed/response-object.js.map +7 -0
- package/dist/schemas/3.1/processed/responses-object.js +17 -30
- package/dist/schemas/3.1/processed/responses-object.js.map +7 -0
- package/dist/schemas/3.1/processed/runtime-expression.js +50 -81
- package/dist/schemas/3.1/processed/runtime-expression.js.map +7 -0
- package/dist/schemas/3.1/processed/schema-object.js +88 -89
- package/dist/schemas/3.1/processed/schema-object.js.map +7 -0
- package/dist/schemas/3.1/processed/schema-object.test.js +310 -0
- package/dist/schemas/3.1/processed/schema-object.test.js.map +7 -0
- package/dist/schemas/3.1/processed/security-requirement-object.js +20 -36
- package/dist/schemas/3.1/processed/security-requirement-object.js.map +7 -0
- package/dist/schemas/3.1/processed/security-scheme-object.js +114 -142
- package/dist/schemas/3.1/processed/security-scheme-object.js.map +7 -0
- package/dist/schemas/3.1/processed/server-object.js +19 -25
- package/dist/schemas/3.1/processed/server-object.js.map +7 -0
- package/dist/schemas/3.1/processed/server-variable-object.js +19 -25
- package/dist/schemas/3.1/processed/server-variable-object.js.map +7 -0
- package/dist/schemas/3.1/processed/tag-object.js +12 -19
- package/dist/schemas/3.1/processed/tag-object.js.map +7 -0
- package/dist/schemas/3.1/processed/webhooks-object.js +6 -18
- package/dist/schemas/3.1/processed/webhooks-object.js.map +7 -0
- package/dist/schemas/3.1/processed/xml-object.js +28 -38
- package/dist/schemas/3.1/processed/xml-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/base-path-item-object.js +16 -22
- package/dist/schemas/3.1/unprocessed/base-path-item-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/callback-object.js +6 -15
- package/dist/schemas/3.1/unprocessed/callback-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/components-object.js +58 -65
- package/dist/schemas/3.1/unprocessed/components-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/contact-object.js +6 -12
- package/dist/schemas/3.1/unprocessed/contact-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/discriminator-object.js +6 -17
- package/dist/schemas/3.1/unprocessed/discriminator-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/encoding-object.js +14 -25
- package/dist/schemas/3.1/unprocessed/encoding-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/example-object.js +6 -16
- package/dist/schemas/3.1/unprocessed/example-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/external-documentation-object.js +6 -12
- package/dist/schemas/3.1/unprocessed/external-documentation-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/header-object.js +25 -41
- package/dist/schemas/3.1/unprocessed/header-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/index.js +89 -31
- package/dist/schemas/3.1/unprocessed/index.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/info-object.js +6 -13
- package/dist/schemas/3.1/unprocessed/info-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/license-object.js +6 -12
- package/dist/schemas/3.1/unprocessed/license-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/link-object.js +6 -20
- package/dist/schemas/3.1/unprocessed/link-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/media-type-object-without-encoding.js +6 -12
- package/dist/schemas/3.1/unprocessed/media-type-object-without-encoding.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/media-type-object.js +33 -39
- package/dist/schemas/3.1/unprocessed/media-type-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/openapi-object.js +6 -12
- package/dist/schemas/3.1/unprocessed/openapi-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/operation-object-without-callbacks.js +38 -44
- package/dist/schemas/3.1/unprocessed/operation-object-without-callbacks.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/operation-object.js +15 -21
- package/dist/schemas/3.1/unprocessed/operation-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/parameter-object.js +22 -30
- package/dist/schemas/3.1/unprocessed/parameter-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/path-item-object-without-callbacks.js +38 -46
- package/dist/schemas/3.1/unprocessed/path-item-object-without-callbacks.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/path-item-object.js +52 -60
- package/dist/schemas/3.1/unprocessed/path-item-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/paths-object.js +6 -14
- package/dist/schemas/3.1/unprocessed/paths-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/reference-object.js +20 -28
- package/dist/schemas/3.1/unprocessed/reference-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/request-body-object.js +6 -12
- package/dist/schemas/3.1/unprocessed/request-body-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/response-object.js +27 -33
- package/dist/schemas/3.1/unprocessed/response-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/responses-object.js +18 -31
- package/dist/schemas/3.1/unprocessed/responses-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/runtime-expression.js +6 -17
- package/dist/schemas/3.1/unprocessed/runtime-expression.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/schema-object.js +31 -32
- package/dist/schemas/3.1/unprocessed/schema-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/security-requirement-object.js +6 -23
- package/dist/schemas/3.1/unprocessed/security-requirement-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/security-scheme-object.js +41 -29
- package/dist/schemas/3.1/unprocessed/security-scheme-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/server-object.js +6 -12
- package/dist/schemas/3.1/unprocessed/server-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/server-variable-object.js +6 -12
- package/dist/schemas/3.1/unprocessed/server-variable-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/tag-object.js +6 -13
- package/dist/schemas/3.1/unprocessed/tag-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/webhooks-object.js +6 -18
- package/dist/schemas/3.1/unprocessed/webhooks-object.js.map +7 -0
- package/dist/schemas/3.1/unprocessed/xml-object.js +6 -16
- package/dist/schemas/3.1/unprocessed/xml-object.js.map +7 -0
- package/dist/schemas/extensions/index.d.ts +1 -0
- package/dist/schemas/extensions/index.d.ts.map +1 -1
- package/dist/schemas/extensions/index.js +29 -10
- package/dist/schemas/extensions/index.js.map +7 -0
- package/dist/schemas/extensions/x-additional-properties-name.js +6 -12
- package/dist/schemas/extensions/x-additional-properties-name.js.map +7 -0
- package/dist/schemas/extensions/x-additional-properties-name.test.js +28 -0
- package/dist/schemas/extensions/x-additional-properties-name.test.js.map +7 -0
- package/dist/schemas/extensions/x-code-samples.js +12 -10
- package/dist/schemas/extensions/x-code-samples.js.map +7 -0
- package/dist/schemas/extensions/x-code-samples.test.js +82 -0
- package/dist/schemas/extensions/x-code-samples.test.js.map +7 -0
- package/dist/schemas/extensions/x-display-name.js +8 -0
- package/dist/schemas/extensions/x-display-name.js.map +7 -0
- package/dist/schemas/extensions/x-display-name.test.js +28 -0
- package/dist/schemas/extensions/x-display-name.test.js.map +7 -0
- package/dist/schemas/extensions/x-enum-descriptions.js +6 -18
- package/dist/schemas/extensions/x-enum-descriptions.js.map +7 -0
- package/dist/schemas/extensions/x-enum-descriptions.test.js +36 -0
- package/dist/schemas/extensions/x-enum-descriptions.test.js.map +7 -0
- package/dist/schemas/extensions/x-internal.js +6 -5
- package/dist/schemas/extensions/x-internal.js.map +7 -0
- package/dist/schemas/extensions/x-internal.test.js +20 -0
- package/dist/schemas/extensions/x-internal.test.js.map +7 -0
- package/dist/schemas/extensions/x-scalar-icon.js +6 -5
- package/dist/schemas/extensions/x-scalar-icon.js.map +7 -0
- package/dist/schemas/extensions/x-scalar-icon.test.js +14 -0
- package/dist/schemas/extensions/x-scalar-icon.test.js.map +7 -0
- package/dist/schemas/extensions/x-scalar-ignore.js +6 -5
- package/dist/schemas/extensions/x-scalar-ignore.js.map +7 -0
- package/dist/schemas/extensions/x-scalar-ignore.test.js +20 -0
- package/dist/schemas/extensions/x-scalar-ignore.test.js.map +7 -0
- package/dist/schemas/extensions/x-scalar-redirect-uri.js +6 -5
- package/dist/schemas/extensions/x-scalar-redirect-uri.js.map +7 -0
- package/dist/schemas/extensions/x-scalar-redirect-uri.test.js +23 -0
- package/dist/schemas/extensions/x-scalar-redirect-uri.test.js.map +7 -0
- package/dist/schemas/extensions/x-scalar-sdk-installation.d.ts +25 -0
- package/dist/schemas/extensions/x-scalar-sdk-installation.d.ts.map +1 -0
- package/dist/schemas/extensions/x-scalar-sdk-installation.js +12 -0
- package/dist/schemas/extensions/x-scalar-sdk-installation.js.map +7 -0
- package/dist/schemas/extensions/x-scalar-sdk-installation.test.js +25 -0
- package/dist/schemas/extensions/x-scalar-sdk-installation.test.js.map +7 -0
- package/dist/schemas/extensions/x-scalar-stability.js +10 -19
- package/dist/schemas/extensions/x-scalar-stability.js.map +7 -0
- package/dist/schemas/extensions/x-scalar-stability.test.js +33 -0
- package/dist/schemas/extensions/x-scalar-stability.test.js.map +7 -0
- package/dist/schemas/extensions/x-tag-groups.js +14 -17
- package/dist/schemas/extensions/x-tag-groups.js.map +7 -0
- package/dist/schemas/extensions/x-tag-groups.test.js +55 -0
- package/dist/schemas/extensions/x-tag-groups.test.js.map +7 -0
- package/dist/schemas/extensions/x-use-pkce.js +11 -10
- package/dist/schemas/extensions/x-use-pkce.js.map +7 -0
- package/dist/schemas/extensions/x-use-pkce.test.js +34 -0
- package/dist/schemas/extensions/x-use-pkce.test.js.map +7 -0
- package/package.json +12 -13
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { SecuritySchemeObjectSchema } from "../unprocessed/security-scheme-object.js";
|
|
3
|
+
describe("security-scheme-object", () => {
|
|
4
|
+
describe("SecuritySchemeObjectSchema", () => {
|
|
5
|
+
describe("Security Scheme Object Examples", () => {
|
|
6
|
+
it("Basic Authentication Example", () => {
|
|
7
|
+
const result = SecuritySchemeObjectSchema.parse({
|
|
8
|
+
type: "http",
|
|
9
|
+
scheme: "basic"
|
|
10
|
+
});
|
|
11
|
+
expect(result).toEqual({
|
|
12
|
+
type: "http",
|
|
13
|
+
scheme: "basic"
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
it("API Key Example", () => {
|
|
17
|
+
const result = SecuritySchemeObjectSchema.parse({
|
|
18
|
+
type: "apiKey",
|
|
19
|
+
name: "api-key",
|
|
20
|
+
in: "header"
|
|
21
|
+
});
|
|
22
|
+
expect(result).toEqual({
|
|
23
|
+
type: "apiKey",
|
|
24
|
+
name: "api-key",
|
|
25
|
+
in: "header"
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
it("JWT Bearer Example", () => {
|
|
29
|
+
const result = SecuritySchemeObjectSchema.parse({
|
|
30
|
+
type: "http",
|
|
31
|
+
scheme: "bearer",
|
|
32
|
+
bearerFormat: "JWT"
|
|
33
|
+
});
|
|
34
|
+
expect(result).toEqual({
|
|
35
|
+
type: "http",
|
|
36
|
+
scheme: "bearer",
|
|
37
|
+
bearerFormat: "JWT"
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
it("MutualTLS Example", () => {
|
|
41
|
+
const result = SecuritySchemeObjectSchema.parse({
|
|
42
|
+
type: "mutualTLS",
|
|
43
|
+
description: "Cert must be signed by example.com CA"
|
|
44
|
+
});
|
|
45
|
+
expect(result).toEqual({
|
|
46
|
+
type: "mutualTLS",
|
|
47
|
+
description: "Cert must be signed by example.com CA"
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
it("Implicit OAuth2 Example", () => {
|
|
51
|
+
const result = SecuritySchemeObjectSchema.parse({
|
|
52
|
+
type: "oauth2",
|
|
53
|
+
flows: {
|
|
54
|
+
implicit: {
|
|
55
|
+
authorizationUrl: "https://example.com/api/oauth/dialog",
|
|
56
|
+
scopes: {
|
|
57
|
+
"write:pets": "modify pets in your account",
|
|
58
|
+
"read:pets": "read your pets"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
expect(result).toEqual({
|
|
64
|
+
type: "oauth2",
|
|
65
|
+
flows: {
|
|
66
|
+
implicit: {
|
|
67
|
+
authorizationUrl: "https://example.com/api/oauth/dialog",
|
|
68
|
+
scopes: {
|
|
69
|
+
"write:pets": "modify pets in your account",
|
|
70
|
+
"read:pets": "read your pets"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
describe("OAuth Flow Object Example", () => {
|
|
79
|
+
it("Implicit Flow", () => {
|
|
80
|
+
const result = SecuritySchemeObjectSchema.parse({
|
|
81
|
+
type: "oauth2",
|
|
82
|
+
flows: {
|
|
83
|
+
implicit: {
|
|
84
|
+
authorizationUrl: "https://example.com/api/oauth/dialog",
|
|
85
|
+
scopes: {
|
|
86
|
+
"write:pets": "modify pets in your account",
|
|
87
|
+
"read:pets": "read your pets"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
authorizationCode: {
|
|
91
|
+
authorizationUrl: "https://example.com/api/oauth/dialog",
|
|
92
|
+
tokenUrl: "https://example.com/api/oauth/token",
|
|
93
|
+
scopes: {
|
|
94
|
+
"write:pets": "modify pets in your account",
|
|
95
|
+
"read:pets": "read your pets"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
expect(result).toEqual({
|
|
101
|
+
type: "oauth2",
|
|
102
|
+
flows: {
|
|
103
|
+
implicit: {
|
|
104
|
+
authorizationUrl: "https://example.com/api/oauth/dialog",
|
|
105
|
+
scopes: {
|
|
106
|
+
"write:pets": "modify pets in your account",
|
|
107
|
+
"read:pets": "read your pets"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
authorizationCode: {
|
|
111
|
+
authorizationUrl: "https://example.com/api/oauth/dialog",
|
|
112
|
+
tokenUrl: "https://example.com/api/oauth/token",
|
|
113
|
+
scopes: {
|
|
114
|
+
"write:pets": "modify pets in your account",
|
|
115
|
+
"read:pets": "read your pets"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
//# sourceMappingURL=security-scheme-object.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/schemas/3.1/compliance/security-scheme-object.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { SecuritySchemeObjectSchema } from '../unprocessed/security-scheme-object'\n\ndescribe('security-scheme-object', () => {\n describe('SecuritySchemeObjectSchema', () => {\n // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#security-scheme-object-examples\n describe('Security Scheme Object Examples', () => {\n it('Basic Authentication Example', () => {\n const result = SecuritySchemeObjectSchema.parse({\n type: 'http',\n scheme: 'basic',\n })\n\n expect(result).toEqual({\n type: 'http',\n scheme: 'basic',\n })\n })\n\n it('API Key Example', () => {\n const result = SecuritySchemeObjectSchema.parse({\n type: 'apiKey',\n name: 'api-key',\n in: 'header',\n })\n\n expect(result).toEqual({\n type: 'apiKey',\n name: 'api-key',\n in: 'header',\n })\n })\n\n it('JWT Bearer Example', () => {\n const result = SecuritySchemeObjectSchema.parse({\n type: 'http',\n scheme: 'bearer',\n bearerFormat: 'JWT',\n })\n\n expect(result).toEqual({\n type: 'http',\n scheme: 'bearer',\n bearerFormat: 'JWT',\n })\n })\n\n it('MutualTLS Example', () => {\n const result = SecuritySchemeObjectSchema.parse({\n type: 'mutualTLS',\n description: 'Cert must be signed by example.com CA',\n })\n\n expect(result).toEqual({\n type: 'mutualTLS',\n description: 'Cert must be signed by example.com CA',\n })\n })\n\n it('Implicit OAuth2 Example', () => {\n const result = SecuritySchemeObjectSchema.parse({\n type: 'oauth2',\n flows: {\n implicit: {\n authorizationUrl: 'https://example.com/api/oauth/dialog',\n scopes: {\n 'write:pets': 'modify pets in your account',\n 'read:pets': 'read your pets',\n },\n },\n },\n })\n\n expect(result).toEqual({\n type: 'oauth2',\n flows: {\n implicit: {\n authorizationUrl: 'https://example.com/api/oauth/dialog',\n scopes: {\n 'write:pets': 'modify pets in your account',\n 'read:pets': 'read your pets',\n },\n },\n },\n })\n })\n })\n })\n\n // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#oauth-flow-object-example\n describe('OAuth Flow Object Example', () => {\n it('Implicit Flow', () => {\n const result = SecuritySchemeObjectSchema.parse({\n type: 'oauth2',\n flows: {\n implicit: {\n authorizationUrl: 'https://example.com/api/oauth/dialog',\n scopes: {\n 'write:pets': 'modify pets in your account',\n 'read:pets': 'read your pets',\n },\n },\n authorizationCode: {\n authorizationUrl: 'https://example.com/api/oauth/dialog',\n tokenUrl: 'https://example.com/api/oauth/token',\n scopes: {\n 'write:pets': 'modify pets in your account',\n 'read:pets': 'read your pets',\n },\n },\n },\n })\n\n expect(result).toEqual({\n type: 'oauth2',\n flows: {\n implicit: {\n authorizationUrl: 'https://example.com/api/oauth/dialog',\n scopes: {\n 'write:pets': 'modify pets in your account',\n 'read:pets': 'read your pets',\n },\n },\n authorizationCode: {\n authorizationUrl: 'https://example.com/api/oauth/dialog',\n tokenUrl: 'https://example.com/api/oauth/token',\n scopes: {\n 'write:pets': 'modify pets in your account',\n 'read:pets': 'read your pets',\n },\n },\n },\n })\n })\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,kCAAkC;AAE3C,SAAS,0BAA0B,MAAM;AACvC,WAAS,8BAA8B,MAAM;AAE3C,aAAS,mCAAmC,MAAM;AAChD,SAAG,gCAAgC,MAAM;AACvC,cAAM,SAAS,2BAA2B,MAAM;AAAA,UAC9C,MAAM;AAAA,UACN,QAAQ;AAAA,QACV,CAAC;AAED,eAAO,MAAM,EAAE,QAAQ;AAAA,UACrB,MAAM;AAAA,UACN,QAAQ;AAAA,QACV,CAAC;AAAA,MACH,CAAC;AAED,SAAG,mBAAmB,MAAM;AAC1B,cAAM,SAAS,2BAA2B,MAAM;AAAA,UAC9C,MAAM;AAAA,UACN,MAAM;AAAA,UACN,IAAI;AAAA,QACN,CAAC;AAED,eAAO,MAAM,EAAE,QAAQ;AAAA,UACrB,MAAM;AAAA,UACN,MAAM;AAAA,UACN,IAAI;AAAA,QACN,CAAC;AAAA,MACH,CAAC;AAED,SAAG,sBAAsB,MAAM;AAC7B,cAAM,SAAS,2BAA2B,MAAM;AAAA,UAC9C,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,cAAc;AAAA,QAChB,CAAC;AAED,eAAO,MAAM,EAAE,QAAQ;AAAA,UACrB,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,cAAc;AAAA,QAChB,CAAC;AAAA,MACH,CAAC;AAED,SAAG,qBAAqB,MAAM;AAC5B,cAAM,SAAS,2BAA2B,MAAM;AAAA,UAC9C,MAAM;AAAA,UACN,aAAa;AAAA,QACf,CAAC;AAED,eAAO,MAAM,EAAE,QAAQ;AAAA,UACrB,MAAM;AAAA,UACN,aAAa;AAAA,QACf,CAAC;AAAA,MACH,CAAC;AAED,SAAG,2BAA2B,MAAM;AAClC,cAAM,SAAS,2BAA2B,MAAM;AAAA,UAC9C,MAAM;AAAA,UACN,OAAO;AAAA,YACL,UAAU;AAAA,cACR,kBAAkB;AAAA,cAClB,QAAQ;AAAA,gBACN,cAAc;AAAA,gBACd,aAAa;AAAA,cACf;AAAA,YACF;AAAA,UACF;AAAA,QACF,CAAC;AAED,eAAO,MAAM,EAAE,QAAQ;AAAA,UACrB,MAAM;AAAA,UACN,OAAO;AAAA,YACL,UAAU;AAAA,cACR,kBAAkB;AAAA,cAClB,QAAQ;AAAA,gBACN,cAAc;AAAA,gBACd,aAAa;AAAA,cACf;AAAA,YACF;AAAA,UACF;AAAA,QACF,CAAC;AAAA,MACH,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AAGD,WAAS,6BAA6B,MAAM;AAC1C,OAAG,iBAAiB,MAAM;AACxB,YAAM,SAAS,2BAA2B,MAAM;AAAA,QAC9C,MAAM;AAAA,QACN,OAAO;AAAA,UACL,UAAU;AAAA,YACR,kBAAkB;AAAA,YAClB,QAAQ;AAAA,cACN,cAAc;AAAA,cACd,aAAa;AAAA,YACf;AAAA,UACF;AAAA,UACA,mBAAmB;AAAA,YACjB,kBAAkB;AAAA,YAClB,UAAU;AAAA,YACV,QAAQ;AAAA,cACN,cAAc;AAAA,cACd,aAAa;AAAA,YACf;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC;AAED,aAAO,MAAM,EAAE,QAAQ;AAAA,QACrB,MAAM;AAAA,QACN,OAAO;AAAA,UACL,UAAU;AAAA,YACR,kBAAkB;AAAA,YAClB,QAAQ;AAAA,cACN,cAAc;AAAA,cACd,aAAa;AAAA,YACf;AAAA,UACF;AAAA,UACA,mBAAmB;AAAA,YACjB,kBAAkB;AAAA,YAClB,UAAU;AAAA,YACV,QAAQ;AAAA,cACN,cAAc;AAAA,cACd,aAAa;AAAA,YACf;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { ServerObjectSchema } from "../unprocessed/server-object.js";
|
|
3
|
+
describe("server-object", () => {
|
|
4
|
+
describe("ServerObjectSchema", () => {
|
|
5
|
+
it("parses a single server", () => {
|
|
6
|
+
const result = ServerObjectSchema.parse({
|
|
7
|
+
url: "https://development.gigantic-server.com/v1",
|
|
8
|
+
description: "Development server"
|
|
9
|
+
});
|
|
10
|
+
expect(result).toEqual({
|
|
11
|
+
url: "https://development.gigantic-server.com/v1",
|
|
12
|
+
description: "Development server"
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=server-object.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/schemas/3.1/compliance/server-object.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { ServerObjectSchema } from '../unprocessed/server-object'\n\ndescribe('server-object', () => {\n describe('ServerObjectSchema', () => {\n // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#server-object-example\n it('parses a single server', () => {\n const result = ServerObjectSchema.parse({\n url: 'https://development.gigantic-server.com/v1',\n description: 'Development server',\n })\n\n expect(result).toEqual({\n url: 'https://development.gigantic-server.com/v1',\n description: 'Development server',\n })\n })\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,0BAA0B;AAEnC,SAAS,iBAAiB,MAAM;AAC9B,WAAS,sBAAsB,MAAM;AAEnC,OAAG,0BAA0B,MAAM;AACjC,YAAM,SAAS,mBAAmB,MAAM;AAAA,QACtC,KAAK;AAAA,QACL,aAAa;AAAA,MACf,CAAC;AAED,aAAO,MAAM,EAAE,QAAQ;AAAA,QACrB,KAAK;AAAA,QACL,aAAa;AAAA,MACf,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { TagObjectSchema } from "../unprocessed/tag-object.js";
|
|
3
|
+
describe("tag-object", () => {
|
|
4
|
+
describe("TagObjectSchema", () => {
|
|
5
|
+
it("Tag Object Example", () => {
|
|
6
|
+
const result = TagObjectSchema.parse({
|
|
7
|
+
name: "pet",
|
|
8
|
+
description: "Pets operations"
|
|
9
|
+
});
|
|
10
|
+
expect(result).toEqual({
|
|
11
|
+
name: "pet",
|
|
12
|
+
description: "Pets operations"
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=tag-object.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/schemas/3.1/compliance/tag-object.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { TagObjectSchema } from '../unprocessed/tag-object'\n\ndescribe('tag-object', () => {\n describe('TagObjectSchema', () => {\n // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#tag-object-example\n it('Tag Object Example', () => {\n const result = TagObjectSchema.parse({\n name: 'pet',\n description: 'Pets operations',\n })\n\n expect(result).toEqual({\n name: 'pet',\n description: 'Pets operations',\n })\n })\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,uBAAuB;AAEhC,SAAS,cAAc,MAAM;AAC3B,WAAS,mBAAmB,MAAM;AAEhC,OAAG,sBAAsB,MAAM;AAC7B,YAAM,SAAS,gBAAgB,MAAM;AAAA,QACnC,MAAM;AAAA,QACN,aAAa;AAAA,MACf,CAAC;AAED,aAAO,MAAM,EAAE,QAAQ;AAAA,QACrB,MAAM;AAAA,QACN,aAAa;AAAA,MACf,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { ParameterObjectSchema } from
|
|
3
|
-
import { ServerObjectSchema } from
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Base Path Item Object Schema
|
|
7
|
-
*
|
|
8
|
-
* This helps break circular dependencies between path-item-object and callback-object
|
|
9
|
-
*
|
|
10
|
-
* @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#path-item-object
|
|
11
|
-
*/
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ParameterObjectSchema } from "./parameter-object.js";
|
|
3
|
+
import { ServerObjectSchema } from "./server-object.js";
|
|
12
4
|
const BasePathItemObjectSchema = z.object({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
5
|
+
/**
|
|
6
|
+
* An optional, string summary, intended to apply to all operations in this path.
|
|
7
|
+
*/
|
|
8
|
+
summary: z.string().optional(),
|
|
9
|
+
/**
|
|
10
|
+
* An optional, string description, intended to apply to all operations in this path. CommonMark syntax MAY be used
|
|
11
|
+
* for rich text representation.
|
|
12
|
+
*/
|
|
13
|
+
description: z.string().optional(),
|
|
14
|
+
/**
|
|
15
|
+
* An alternative server array to service all operations in this path.
|
|
16
|
+
*/
|
|
17
|
+
servers: z.array(ServerObjectSchema).optional(),
|
|
18
|
+
/**
|
|
19
|
+
* A list of parameters that are applicable for all the operations described under this path. These parameters can be
|
|
20
|
+
* overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A
|
|
21
|
+
* unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link
|
|
22
|
+
* to parameters that are defined at the OpenAPI Object's components/parameters.
|
|
23
|
+
*/
|
|
24
|
+
parameters: z.array(ParameterObjectSchema).optional()
|
|
33
25
|
});
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
export {
|
|
27
|
+
BasePathItemObjectSchema
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=base-path-item-object.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/schemas/3.1/processed/base-path-item-object.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\nimport { ParameterObjectSchema } from './parameter-object'\nimport { ServerObjectSchema } from './server-object'\n\n/**\n * Base Path Item Object Schema\n *\n * This helps break circular dependencies between path-item-object and callback-object\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#path-item-object\n */\nexport const BasePathItemObjectSchema = z.object({\n /**\n * An optional, string summary, intended to apply to all operations in this path.\n */\n summary: z.string().optional(),\n /**\n * An optional, string description, intended to apply to all operations in this path. CommonMark syntax MAY be used\n * for rich text representation.\n */\n description: z.string().optional(),\n /**\n * An alternative server array to service all operations in this path.\n */\n servers: z.array(ServerObjectSchema).optional(),\n /**\n * A list of parameters that are applicable for all the operations described under this path. These parameters can be\n * overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A\n * unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link\n * to parameters that are defined at the OpenAPI Object's components/parameters.\n */\n parameters: z.array(ParameterObjectSchema).optional(),\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,6BAA6B;AACtC,SAAS,0BAA0B;AAS5B,MAAM,2BAA2B,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA,EAI/C,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAK7B,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAIjC,SAAS,EAAE,MAAM,kBAAkB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO9C,YAAY,EAAE,MAAM,qBAAqB,EAAE,SAAS;AACtD,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { PathItemObjectSchemaWithoutCallbacks } from
|
|
3
|
-
import { RuntimeExpressionSchema } from
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Callback Object
|
|
7
|
-
*
|
|
8
|
-
* A map of possible out-of-band callbacks related to the parent operation. Each value in the map is a
|
|
9
|
-
* Path Item Object that describes a set of requests that may be initiated by the API provider and the
|
|
10
|
-
* expected responses. The key value used to identify the callback object is an expression, evaluated
|
|
11
|
-
* at runtime, that identifies a URL to be used for the callback operation.
|
|
12
|
-
*
|
|
13
|
-
* @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#callback-object
|
|
14
|
-
*/
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PathItemObjectSchemaWithoutCallbacks } from "./path-item-object-without-callbacks.js";
|
|
3
|
+
import { RuntimeExpressionSchema } from "./runtime-expression.js";
|
|
15
4
|
const CallbackObjectSchema = z.record(RuntimeExpressionSchema, PathItemObjectSchemaWithoutCallbacks);
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
export {
|
|
6
|
+
CallbackObjectSchema
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=callback-object.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/schemas/3.1/processed/callback-object.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\nimport { PathItemObjectSchemaWithoutCallbacks } from './path-item-object-without-callbacks'\nimport { RuntimeExpressionSchema } from './runtime-expression'\n\n/**\n * Callback Object\n *\n * A map of possible out-of-band callbacks related to the parent operation. Each value in the map is a\n * Path Item Object that describes a set of requests that may be initiated by the API provider and the\n * expected responses. The key value used to identify the callback object is an expression, evaluated\n * at runtime, that identifies a URL to be used for the callback operation.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#callback-object\n */\nexport const CallbackObjectSchema = z.record(RuntimeExpressionSchema, PathItemObjectSchemaWithoutCallbacks)\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,4CAA4C;AACrD,SAAS,+BAA+B;AAYjC,MAAM,uBAAuB,EAAE,OAAO,yBAAyB,oCAAoC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,64 +1,57 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { CallbackObjectSchema } from
|
|
3
|
-
import { ExampleObjectSchema } from
|
|
4
|
-
import { HeaderObjectSchema } from
|
|
5
|
-
import { LinkObjectSchema } from
|
|
6
|
-
import { ParameterObjectSchema } from
|
|
7
|
-
import { PathItemObjectSchema } from
|
|
8
|
-
import { RequestBodyObjectSchema } from
|
|
9
|
-
import { ResponseObjectSchema } from
|
|
10
|
-
import { SchemaObjectSchema } from
|
|
11
|
-
import { SecuritySchemeObjectSchema } from
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Components Object
|
|
15
|
-
*
|
|
16
|
-
* Holds a set of reusable objects for different aspects of the OAS. All objects defined within the Components Object
|
|
17
|
-
* will have no effect on the API unless they are explicitly referenced from outside the Components Object.
|
|
18
|
-
*
|
|
19
|
-
* @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#components-object
|
|
20
|
-
*/
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CallbackObjectSchema } from "./callback-object.js";
|
|
3
|
+
import { ExampleObjectSchema } from "./example-object.js";
|
|
4
|
+
import { HeaderObjectSchema } from "./header-object.js";
|
|
5
|
+
import { LinkObjectSchema } from "./link-object.js";
|
|
6
|
+
import { ParameterObjectSchema } from "./parameter-object.js";
|
|
7
|
+
import { PathItemObjectSchema } from "./path-item-object.js";
|
|
8
|
+
import { RequestBodyObjectSchema } from "./request-body-object.js";
|
|
9
|
+
import { ResponseObjectSchema } from "./response-object.js";
|
|
10
|
+
import { SchemaObjectSchema } from "./schema-object.js";
|
|
11
|
+
import { SecuritySchemeObjectSchema } from "./security-scheme-object.js";
|
|
21
12
|
const ComponentsObjectSchema = z.object({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
13
|
+
/**
|
|
14
|
+
* An object to hold reusable Schema Objects.
|
|
15
|
+
*/
|
|
16
|
+
schemas: z.record(z.string(), SchemaObjectSchema).optional(),
|
|
17
|
+
/**
|
|
18
|
+
* An object to hold reusable Response Objects.
|
|
19
|
+
*/
|
|
20
|
+
responses: z.record(z.string(), ResponseObjectSchema).optional(),
|
|
21
|
+
/**
|
|
22
|
+
* An object to hold reusable Parameter Objects.
|
|
23
|
+
*/
|
|
24
|
+
parameters: z.record(z.string(), ParameterObjectSchema).optional(),
|
|
25
|
+
/**
|
|
26
|
+
* An object to hold reusable Example Objects.
|
|
27
|
+
*/
|
|
28
|
+
examples: z.record(z.string(), ExampleObjectSchema).optional(),
|
|
29
|
+
/**
|
|
30
|
+
* An object to hold reusable Request Body Objects.
|
|
31
|
+
*/
|
|
32
|
+
requestBodies: z.record(z.string(), RequestBodyObjectSchema).optional(),
|
|
33
|
+
/**
|
|
34
|
+
* An object to hold reusable Header Objects.
|
|
35
|
+
*/
|
|
36
|
+
headers: z.record(z.string(), HeaderObjectSchema).optional(),
|
|
37
|
+
/**
|
|
38
|
+
* An object to hold reusable Security Scheme Objects.
|
|
39
|
+
*/
|
|
40
|
+
securitySchemes: z.record(z.string(), SecuritySchemeObjectSchema).optional(),
|
|
41
|
+
/**
|
|
42
|
+
* An object to hold reusable Link Objects.
|
|
43
|
+
*/
|
|
44
|
+
links: z.record(z.string(), LinkObjectSchema).optional(),
|
|
45
|
+
/**
|
|
46
|
+
* An object to hold reusable Callback Objects.
|
|
47
|
+
*/
|
|
48
|
+
callbacks: z.record(z.string(), CallbackObjectSchema).optional(),
|
|
49
|
+
/**
|
|
50
|
+
* An object to hold reusable Path Item Objects.
|
|
51
|
+
*/
|
|
52
|
+
pathItems: z.record(z.string(), PathItemObjectSchema).optional()
|
|
62
53
|
});
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
export {
|
|
55
|
+
ComponentsObjectSchema
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=components-object.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/schemas/3.1/processed/components-object.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\nimport { CallbackObjectSchema } from './callback-object'\nimport { ExampleObjectSchema } from './example-object'\nimport { HeaderObjectSchema } from './header-object'\nimport { LinkObjectSchema } from './link-object'\nimport { ParameterObjectSchema } from './parameter-object'\nimport { PathItemObjectSchema } from './path-item-object'\nimport { RequestBodyObjectSchema } from './request-body-object'\nimport { ResponseObjectSchema } from './response-object'\nimport { SchemaObjectSchema } from './schema-object'\nimport { SecuritySchemeObjectSchema } from './security-scheme-object'\n\n/**\n * Components Object\n *\n * Holds a set of reusable objects for different aspects of the OAS. All objects defined within the Components Object\n * will have no effect on the API unless they are explicitly referenced from outside the Components Object.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#components-object\n */\nexport const ComponentsObjectSchema = z.object({\n /**\n * An object to hold reusable Schema Objects.\n */\n schemas: z.record(z.string(), SchemaObjectSchema).optional(),\n /**\n * An object to hold reusable Response Objects.\n */\n responses: z.record(z.string(), ResponseObjectSchema).optional(),\n /**\n * An object to hold reusable Parameter Objects.\n */\n parameters: z.record(z.string(), ParameterObjectSchema).optional(),\n /**\n * An object to hold reusable Example Objects.\n */\n examples: z.record(z.string(), ExampleObjectSchema).optional(),\n /**\n * An object to hold reusable Request Body Objects.\n */\n requestBodies: z.record(z.string(), RequestBodyObjectSchema).optional(),\n /**\n * An object to hold reusable Header Objects.\n */\n headers: z.record(z.string(), HeaderObjectSchema).optional(),\n /**\n * An object to hold reusable Security Scheme Objects.\n */\n securitySchemes: z.record(z.string(), SecuritySchemeObjectSchema).optional(),\n /**\n * An object to hold reusable Link Objects.\n */\n links: z.record(z.string(), LinkObjectSchema).optional(),\n /**\n * An object to hold reusable Callback Objects.\n */\n callbacks: z.record(z.string(), CallbackObjectSchema).optional(),\n /**\n * An object to hold reusable Path Item Objects.\n */\n pathItems: z.record(z.string(), PathItemObjectSchema).optional(),\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,6BAA6B;AACtC,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AACxC,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AACnC,SAAS,kCAAkC;AAUpC,MAAM,yBAAyB,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA,EAI7C,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,kBAAkB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAI3D,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,oBAAoB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAI/D,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,qBAAqB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAIjE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,mBAAmB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAI7D,eAAe,EAAE,OAAO,EAAE,OAAO,GAAG,uBAAuB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAItE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,kBAAkB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAI3D,iBAAiB,EAAE,OAAO,EAAE,OAAO,GAAG,0BAA0B,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAI3E,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,gBAAgB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAIvD,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,oBAAoB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAI/D,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,oBAAoB,EAAE,SAAS;AACjE,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Contact Object
|
|
5
|
-
*
|
|
6
|
-
* Contact information for the exposed API.
|
|
7
|
-
*
|
|
8
|
-
* @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#contact-object
|
|
9
|
-
*/
|
|
1
|
+
import { z } from "zod";
|
|
10
2
|
const ContactObjectSchema = z.object({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
/** The identifying name of the contact person/organization. */
|
|
4
|
+
name: z.string().optional(),
|
|
5
|
+
/** The URL pointing to the contact information. This MUST be in the form of a URL. */
|
|
6
|
+
url: z.string().url().optional().catch(void 0),
|
|
7
|
+
/** The email address of the contact person/organization. This MUST be in the form of an email address. */
|
|
8
|
+
email: z.string().optional().catch(void 0)
|
|
17
9
|
});
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
export {
|
|
11
|
+
ContactObjectSchema
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=contact-object.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/schemas/3.1/processed/contact-object.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\n\n/**\n * Contact Object\n *\n * Contact information for the exposed API.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#contact-object\n */\nexport const ContactObjectSchema = z.object({\n /** The identifying name of the contact person/organization. */\n name: z.string().optional(),\n /** The URL pointing to the contact information. This MUST be in the form of a URL. */\n url: z.string().url().optional().catch(undefined),\n /** The email address of the contact person/organization. This MUST be in the form of an email address. */\n email: z.string().optional().catch(undefined),\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AASX,MAAM,sBAAsB,EAAE,OAAO;AAAA;AAAA,EAE1C,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAE1B,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,MAAS;AAAA;AAAA,EAEhD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAS;AAC9C,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Discriminator Object
|
|
5
|
-
*
|
|
6
|
-
* When request bodies or response payloads may be one of a number of different schemas, a Discriminator Object gives a
|
|
7
|
-
* hint about the expected schema of the document. This hint can be used to aid in serialization, deserialization, and
|
|
8
|
-
* validation. The Discriminator Object does this by implicitly or explicitly associating the possible values of a named
|
|
9
|
-
* property with alternative schemas.
|
|
10
|
-
*
|
|
11
|
-
* Note that discriminator MUST NOT change the validation outcome of the schema.
|
|
12
|
-
*
|
|
13
|
-
* @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#discriminator-object
|
|
14
|
-
*/
|
|
1
|
+
import { z } from "zod";
|
|
15
2
|
const DiscriminatorObjectSchema = z.object({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
3
|
+
/**
|
|
4
|
+
* REQUIRED. The name of the property in the payload that will hold the discriminator value.
|
|
5
|
+
* This property SHOULD be required in the payload schema.
|
|
6
|
+
*/
|
|
7
|
+
propertyName: z.string(),
|
|
8
|
+
/**
|
|
9
|
+
* An object to hold mappings between payload values and schema names or references.
|
|
10
|
+
* Keys MUST be strings, but implementations MAY convert response values to strings for comparison.
|
|
11
|
+
*/
|
|
12
|
+
mapping: z.record(z.string(), z.string()).optional()
|
|
26
13
|
});
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
export {
|
|
15
|
+
DiscriminatorObjectSchema
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=discriminator-object.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/schemas/3.1/processed/discriminator-object.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\n\n/**\n * Discriminator Object\n *\n * When request bodies or response payloads may be one of a number of different schemas, a Discriminator Object gives a\n * hint about the expected schema of the document. This hint can be used to aid in serialization, deserialization, and\n * validation. The Discriminator Object does this by implicitly or explicitly associating the possible values of a named\n * property with alternative schemas.\n *\n * Note that discriminator MUST NOT change the validation outcome of the schema.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#discriminator-object\n */\nexport const DiscriminatorObjectSchema = z.object({\n /**\n * REQUIRED. The name of the property in the payload that will hold the discriminator value.\n * This property SHOULD be required in the payload schema.\n */\n propertyName: z.string(),\n\n /**\n * An object to hold mappings between payload values and schema names or references.\n * Keys MUST be strings, but implementations MAY convert response values to strings for comparison.\n */\n mapping: z.record(z.string(), z.string()).optional(),\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAcX,MAAM,4BAA4B,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhD,cAAc,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvB,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS;AACrD,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,30 +1,19 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { HeaderObjectSchema } from
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Encoding Object
|
|
6
|
-
*
|
|
7
|
-
* A single encoding definition applied to a single schema property. See Appendix B for a discussion of converting
|
|
8
|
-
* values of various types to string representations.
|
|
9
|
-
*
|
|
10
|
-
* Properties are correlated with multipart parts using the name parameter of Content-Disposition: form-data, and with
|
|
11
|
-
* application/x-www-form-urlencoded using the query string parameter names. In both cases, their order is
|
|
12
|
-
* implementation-defined.
|
|
13
|
-
*
|
|
14
|
-
* @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#encoding-object
|
|
15
|
-
*/
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { HeaderObjectSchema } from "./header-object.js";
|
|
16
3
|
const EncodingObjectSchema = z.object({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The Content-Type for encoding a specific property. The value is a comma-separated list, each element of which is
|
|
6
|
+
* either a specific media type (e.g. image/png) or a wildcard media type (e.g. image/*). Default value depends on the
|
|
7
|
+
* property type as shown in the table below.
|
|
8
|
+
*/
|
|
9
|
+
contentType: z.string(),
|
|
10
|
+
/**
|
|
11
|
+
* A map allowing additional information to be provided as headers. Content-Type is described separately and SHALL be
|
|
12
|
+
* ignored in this section. This field SHALL be ignored if the request body media type is not a multipart.
|
|
13
|
+
*/
|
|
14
|
+
headers: z.record(z.string(), HeaderObjectSchema).optional()
|
|
28
15
|
});
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
export {
|
|
17
|
+
EncodingObjectSchema
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=encoding-object.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/schemas/3.1/processed/encoding-object.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\nimport { HeaderObjectSchema } from './header-object'\n\n/**\n * Encoding Object\n *\n * A single encoding definition applied to a single schema property. See Appendix B for a discussion of converting\n * values of various types to string representations.\n *\n * Properties are correlated with multipart parts using the name parameter of Content-Disposition: form-data, and with\n * application/x-www-form-urlencoded using the query string parameter names. In both cases, their order is\n * implementation-defined.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#encoding-object\n */\nexport const EncodingObjectSchema = z.object({\n /**\n * The Content-Type for encoding a specific property. The value is a comma-separated list, each element of which is\n * either a specific media type (e.g. image/png) or a wildcard media type (e.g. image/*). Default value depends on the\n * property type as shown in the table below.\n */\n contentType: z.string(),\n /**\n * A map allowing additional information to be provided as headers. Content-Type is described separately and SHALL be\n * ignored in this section. This field SHALL be ignored if the request body media type is not a multipart.\n */\n headers: z.record(z.string(), HeaderObjectSchema).optional(),\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,0BAA0B;AAc5B,MAAM,uBAAuB,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM3C,aAAa,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,kBAAkB,EAAE,SAAS;AAC7D,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|