@scalar/openapi-types 0.3.1 → 0.3.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.
Files changed (99) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/openapi-types.d.ts +2 -11
  3. package/dist/openapi-types.d.ts.map +1 -1
  4. package/dist/openapi-types.js +1 -16
  5. package/dist/openapi-types.js.map +3 -3
  6. package/dist/openapi-types.test-d.js.map +2 -2
  7. package/dist/schemas/3.1/processed/index.d.ts +1 -1
  8. package/dist/schemas/3.1/processed/index.d.ts.map +1 -1
  9. package/dist/schemas/3.1/processed/index.js.map +2 -2
  10. package/dist/schemas/3.1/processed/openapi-object.d.ts +30835 -22
  11. package/dist/schemas/3.1/processed/openapi-object.d.ts.map +1 -1
  12. package/dist/schemas/3.1/processed/openapi-object.js +1 -1
  13. package/dist/schemas/3.1/processed/openapi-object.js.map +2 -2
  14. package/dist/schemas/3.1/unprocessed/index.d.ts +1 -1
  15. package/dist/schemas/3.1/unprocessed/index.d.ts.map +1 -1
  16. package/dist/schemas/3.1/unprocessed/index.js.map +2 -2
  17. package/dist/schemas/3.1/unprocessed/openapi-object.d.ts +22 -23
  18. package/dist/schemas/3.1/unprocessed/openapi-object.d.ts.map +1 -1
  19. package/dist/schemas/3.1/unprocessed/openapi-object.js +55 -1
  20. package/dist/schemas/3.1/unprocessed/openapi-object.js.map +2 -2
  21. package/dist/schemas/3.1/unprocessed/paths-object.d.ts +2268 -265
  22. package/dist/schemas/3.1/unprocessed/paths-object.d.ts.map +1 -1
  23. package/dist/schemas/3.1/unprocessed/paths-object.js +14 -2
  24. package/dist/schemas/3.1/unprocessed/paths-object.js.map +2 -2
  25. package/package.json +2 -2
  26. package/dist/schemas/3.1/compliance/callback-object.test.js +0 -97
  27. package/dist/schemas/3.1/compliance/callback-object.test.js.map +0 -7
  28. package/dist/schemas/3.1/compliance/contact-object.test.js +0 -19
  29. package/dist/schemas/3.1/compliance/contact-object.test.js.map +0 -7
  30. package/dist/schemas/3.1/compliance/example-object.test.js +0 -91
  31. package/dist/schemas/3.1/compliance/example-object.test.js.map +0 -7
  32. package/dist/schemas/3.1/compliance/external-documentation-object.test.js +0 -17
  33. package/dist/schemas/3.1/compliance/external-documentation-object.test.js.map +0 -7
  34. package/dist/schemas/3.1/compliance/header-object.test.js +0 -47
  35. package/dist/schemas/3.1/compliance/header-object.test.js.map +0 -7
  36. package/dist/schemas/3.1/compliance/info-object.test.js +0 -41
  37. package/dist/schemas/3.1/compliance/info-object.test.js.map +0 -7
  38. package/dist/schemas/3.1/compliance/license-object.test.js +0 -17
  39. package/dist/schemas/3.1/compliance/license-object.test.js.map +0 -7
  40. package/dist/schemas/3.1/compliance/media-type-object.test.js +0 -69
  41. package/dist/schemas/3.1/compliance/media-type-object.test.js.map +0 -7
  42. package/dist/schemas/3.1/compliance/openapi-object.test.js +0 -381
  43. package/dist/schemas/3.1/compliance/openapi-object.test.js.map +0 -7
  44. package/dist/schemas/3.1/compliance/operation-object.test.js +0 -467
  45. package/dist/schemas/3.1/compliance/operation-object.test.js.map +0 -7
  46. package/dist/schemas/3.1/compliance/parameter-object.test.js +0 -155
  47. package/dist/schemas/3.1/compliance/parameter-object.test.js.map +0 -7
  48. package/dist/schemas/3.1/compliance/path-item-object.test.js +0 -103
  49. package/dist/schemas/3.1/compliance/path-item-object.test.js.map +0 -7
  50. package/dist/schemas/3.1/compliance/reference-object.test.js +0 -282
  51. package/dist/schemas/3.1/compliance/reference-object.test.js.map +0 -7
  52. package/dist/schemas/3.1/compliance/request-body-object.test.js +0 -97
  53. package/dist/schemas/3.1/compliance/request-body-object.test.js.map +0 -7
  54. package/dist/schemas/3.1/compliance/response-object.test.js +0 -131
  55. package/dist/schemas/3.1/compliance/response-object.test.js.map +0 -7
  56. package/dist/schemas/3.1/compliance/responses-object.test.js +0 -53
  57. package/dist/schemas/3.1/compliance/responses-object.test.js.map +0 -7
  58. package/dist/schemas/3.1/compliance/runtime-expression.test.js +0 -165
  59. package/dist/schemas/3.1/compliance/runtime-expression.test.js.map +0 -7
  60. package/dist/schemas/3.1/compliance/schema-object.test.js +0 -470
  61. package/dist/schemas/3.1/compliance/schema-object.test.js.map +0 -7
  62. package/dist/schemas/3.1/compliance/security-requirement-object.test.js +0 -54
  63. package/dist/schemas/3.1/compliance/security-requirement-object.test.js.map +0 -7
  64. package/dist/schemas/3.1/compliance/security-scheme-object.test.js +0 -123
  65. package/dist/schemas/3.1/compliance/security-scheme-object.test.js.map +0 -7
  66. package/dist/schemas/3.1/compliance/server-object.test.js +0 -17
  67. package/dist/schemas/3.1/compliance/server-object.test.js.map +0 -7
  68. package/dist/schemas/3.1/compliance/tag-object.test.js +0 -17
  69. package/dist/schemas/3.1/compliance/tag-object.test.js.map +0 -7
  70. package/dist/schemas/3.1/processed/schema-object.test.js +0 -310
  71. package/dist/schemas/3.1/processed/schema-object.test.js.map +0 -7
  72. package/dist/schemas/extensions/x-additional-properties-name.test.js +0 -28
  73. package/dist/schemas/extensions/x-additional-properties-name.test.js.map +0 -7
  74. package/dist/schemas/extensions/x-code-samples.test.js +0 -82
  75. package/dist/schemas/extensions/x-code-samples.test.js.map +0 -7
  76. package/dist/schemas/extensions/x-display-name.test.js +0 -28
  77. package/dist/schemas/extensions/x-display-name.test.js.map +0 -7
  78. package/dist/schemas/extensions/x-enum-descriptions.test.js +0 -36
  79. package/dist/schemas/extensions/x-enum-descriptions.test.js.map +0 -7
  80. package/dist/schemas/extensions/x-internal.test.js +0 -20
  81. package/dist/schemas/extensions/x-internal.test.js.map +0 -7
  82. package/dist/schemas/extensions/x-post-response.test.js +0 -24
  83. package/dist/schemas/extensions/x-post-response.test.js.map +0 -7
  84. package/dist/schemas/extensions/x-scalar-icon.test.js +0 -14
  85. package/dist/schemas/extensions/x-scalar-icon.test.js.map +0 -7
  86. package/dist/schemas/extensions/x-scalar-ignore.test.js +0 -20
  87. package/dist/schemas/extensions/x-scalar-ignore.test.js.map +0 -7
  88. package/dist/schemas/extensions/x-scalar-redirect-uri.test.js +0 -23
  89. package/dist/schemas/extensions/x-scalar-redirect-uri.test.js.map +0 -7
  90. package/dist/schemas/extensions/x-scalar-sdk-installation.test.js +0 -25
  91. package/dist/schemas/extensions/x-scalar-sdk-installation.test.js.map +0 -7
  92. package/dist/schemas/extensions/x-scalar-security-query.test.js +0 -35
  93. package/dist/schemas/extensions/x-scalar-security-query.test.js.map +0 -7
  94. package/dist/schemas/extensions/x-scalar-stability.test.js +0 -33
  95. package/dist/schemas/extensions/x-scalar-stability.test.js.map +0 -7
  96. package/dist/schemas/extensions/x-tag-groups.test.js +0 -55
  97. package/dist/schemas/extensions/x-tag-groups.test.js.map +0 -7
  98. package/dist/schemas/extensions/x-use-pkce.test.js +0 -34
  99. package/dist/schemas/extensions/x-use-pkce.test.js.map +0 -7
@@ -1,123 +0,0 @@
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
@@ -1,7 +0,0 @@
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;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AmB;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
- }
@@ -1,17 +0,0 @@
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
@@ -1,7 +0,0 @@
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
- }
@@ -1,17 +0,0 @@
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
@@ -1,7 +0,0 @@
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,310 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { SchemaObjectSchema } from "./schema-object.js";
3
- describe("schema-object", () => {
4
- describe("basic validation", () => {
5
- it("validates a simple string schema", () => {
6
- const schema = {
7
- type: "string",
8
- minLength: 1,
9
- maxLength: 100,
10
- pattern: "^[a-zA-Z]+$"
11
- };
12
- const result = SchemaObjectSchema.safeParse(schema);
13
- expect(result.success).toBe(true);
14
- });
15
- it("validates a complex object schema", () => {
16
- const schema = {
17
- type: "object",
18
- properties: {
19
- id: {
20
- type: "string",
21
- format: "uuid"
22
- },
23
- name: {
24
- type: "string",
25
- minLength: 1
26
- },
27
- age: {
28
- type: "integer",
29
- minimum: 0,
30
- maximum: 150
31
- },
32
- tags: {
33
- type: "array",
34
- items: {
35
- type: "string"
36
- },
37
- uniqueItems: true
38
- }
39
- },
40
- required: ["id", "name"],
41
- additionalProperties: false
42
- };
43
- const result = SchemaObjectSchema.safeParse(schema);
44
- expect(result.success).toBe(true);
45
- });
46
- it("validates array type with tuple validation", () => {
47
- const schema = {
48
- type: "array",
49
- items: {
50
- type: ["string", "number"]
51
- },
52
- minItems: 2,
53
- maxItems: 5,
54
- uniqueItems: true
55
- };
56
- const result = SchemaObjectSchema.safeParse(schema);
57
- expect(result.success).toBe(true);
58
- });
59
- it("validates schema with null type", () => {
60
- const schema = {
61
- type: ["string", "null"],
62
- description: "A nullable string field"
63
- };
64
- const result = SchemaObjectSchema.safeParse(schema);
65
- expect(result.success).toBe(true);
66
- });
67
- });
68
- describe("format compatibility", () => {
69
- it("validates string formats with string type", () => {
70
- const stringFormats = [
71
- "date",
72
- "date-time",
73
- "duration",
74
- "password",
75
- "byte",
76
- "binary",
77
- "email",
78
- "uuid",
79
- "uri",
80
- "uri-reference",
81
- "uri-template",
82
- "hostname",
83
- "ipv4",
84
- "ipv6"
85
- ];
86
- stringFormats.forEach((format) => {
87
- const schema = {
88
- type: "string",
89
- format
90
- };
91
- const result = SchemaObjectSchema.safeParse(schema);
92
- expect(result.success).toBe(true);
93
- });
94
- });
95
- it("validates number formats with numeric types", () => {
96
- const numberFormats = ["float", "double", "int32", "int64"];
97
- numberFormats.forEach((format) => {
98
- const schema = {
99
- type: "number",
100
- format
101
- };
102
- const result = SchemaObjectSchema.safeParse(schema);
103
- expect(result.success).toBe(true);
104
- });
105
- });
106
- });
107
- describe("discriminator validation", () => {
108
- it("validates discriminator with oneOf", () => {
109
- const schema = {
110
- oneOf: [
111
- { type: "object", properties: { type: { const: "dog" } } },
112
- { type: "object", properties: { type: { const: "cat" } } }
113
- ],
114
- discriminator: {
115
- propertyName: "type"
116
- },
117
- required: ["type"]
118
- };
119
- const result = SchemaObjectSchema.safeParse(schema);
120
- expect(result.success).toBe(true);
121
- });
122
- it("validates discriminator with anyOf", () => {
123
- const schema = {
124
- anyOf: [
125
- { type: "object", properties: { type: { const: "dog" } } },
126
- { type: "object", properties: { type: { const: "cat" } } }
127
- ],
128
- discriminator: {
129
- propertyName: "type"
130
- },
131
- required: ["type"]
132
- };
133
- const result = SchemaObjectSchema.safeParse(schema);
134
- expect(result.success).toBe(true);
135
- });
136
- it("validates discriminator with mapping", () => {
137
- const schema = {
138
- oneOf: [
139
- { type: "object", properties: { type: { const: "dog" } } },
140
- { type: "object", properties: { type: { const: "cat" } } }
141
- ],
142
- discriminator: {
143
- propertyName: "type",
144
- mapping: {
145
- dog: "#/components/schemas/Dog",
146
- cat: "#/components/schemas/Cat"
147
- }
148
- },
149
- required: ["type"]
150
- };
151
- const result = SchemaObjectSchema.safeParse(schema);
152
- expect(result.success).toBe(true);
153
- });
154
- });
155
- describe("metadata validation", () => {
156
- it("validates vendor extensions", () => {
157
- const schema = {
158
- type: "string",
159
- "x-custom-extension": true,
160
- "x-another-extension": {
161
- nested: "value"
162
- }
163
- };
164
- const result = SchemaObjectSchema.safeParse(schema);
165
- expect(result.success).toBe(true);
166
- });
167
- });
168
- describe("format validation", () => {
169
- it("validates date format", () => {
170
- const schema = {
171
- type: "string",
172
- format: "date"
173
- };
174
- const result = SchemaObjectSchema.safeParse(schema);
175
- expect(result.success).toBe(true);
176
- });
177
- it("validates email format", () => {
178
- const schema = {
179
- type: "string",
180
- format: "email"
181
- };
182
- const result = SchemaObjectSchema.safeParse(schema);
183
- expect(result.success).toBe(true);
184
- });
185
- it("validates uuid format", () => {
186
- const schema = {
187
- type: "string",
188
- format: "uuid"
189
- };
190
- const result = SchemaObjectSchema.safeParse(schema);
191
- expect(result.success).toBe(true);
192
- });
193
- it("validates int32 format", () => {
194
- const schema = {
195
- type: "integer",
196
- format: "int32"
197
- };
198
- const result = SchemaObjectSchema.safeParse(schema);
199
- expect(result.success).toBe(true);
200
- });
201
- });
202
- describe("OpenAPI extensions", () => {
203
- it("validates xml configuration", () => {
204
- const schema = {
205
- type: "object",
206
- xml: {
207
- name: "Pet",
208
- namespace: "http://example.com/schema",
209
- prefix: "p",
210
- attribute: true,
211
- wrapped: true
212
- }
213
- };
214
- const result = SchemaObjectSchema.safeParse(schema);
215
- expect(result.success).toBe(true);
216
- });
217
- it("validates external documentation", () => {
218
- const schema = {
219
- type: "object",
220
- externalDocs: {
221
- description: "Find more info here",
222
- url: "https://example.com/docs"
223
- }
224
- };
225
- const result = SchemaObjectSchema.safeParse(schema);
226
- expect(result.success).toBe(true);
227
- });
228
- it("validates custom x- extensions", () => {
229
- const schema = {
230
- type: "string",
231
- "x-custom-extension": {
232
- someValue: 123
233
- },
234
- "x-another-extension": true
235
- };
236
- const result = SchemaObjectSchema.safeParse(schema);
237
- expect(result.success).toBe(true);
238
- });
239
- });
240
- describe("schema composition", () => {
241
- it("validates allOf composition", () => {
242
- const schema = {
243
- allOf: [
244
- { type: "object", properties: { name: { type: "string" } } },
245
- { type: "object", properties: { age: { type: "integer" } } }
246
- ]
247
- };
248
- const result = SchemaObjectSchema.safeParse(schema);
249
- expect(result.success).toBe(true);
250
- });
251
- it("validates oneOf with discriminator", () => {
252
- const schema = {
253
- oneOf: [
254
- { type: "object", properties: { type: { const: "dog" }, bark: { type: "boolean" } } },
255
- { type: "object", properties: { type: { const: "cat" }, meow: { type: "boolean" } } }
256
- ],
257
- discriminator: {
258
- propertyName: "type"
259
- },
260
- required: ["type"]
261
- };
262
- const result = SchemaObjectSchema.safeParse(schema);
263
- expect(result.success).toBe(true);
264
- });
265
- it("validates anyOf with multiple types", () => {
266
- const schema = {
267
- anyOf: [{ type: "string", format: "email" }, { type: "string", format: "uri" }, { type: "null" }]
268
- };
269
- const result = SchemaObjectSchema.safeParse(schema);
270
- expect(result.success).toBe(true);
271
- });
272
- it("validates not with complex schema", () => {
273
- const schema = {
274
- not: {
275
- type: "object",
276
- properties: {
277
- forbidden: { type: "boolean", const: true },
278
- restricted: { type: "string", enum: ["no", "nope"] }
279
- },
280
- required: ["forbidden"]
281
- }
282
- };
283
- const result = SchemaObjectSchema.safeParse(schema);
284
- expect(result.success).toBe(true);
285
- });
286
- });
287
- describe("validation errors", () => {
288
- it("rejects invalid type values", () => {
289
- const schema = { type: "invalid" };
290
- const result = SchemaObjectSchema.safeParse(schema);
291
- expect(result.success).toBe(false);
292
- if (!result.success) {
293
- expect(result.error.issues[0].path).toContain("type");
294
- }
295
- });
296
- it("rejects invalid required fields", () => {
297
- const schema = {
298
- type: "object",
299
- properties: {
300
- name: { type: "string" }
301
- },
302
- required: ["age"]
303
- // age is not defined in properties
304
- };
305
- const result = SchemaObjectSchema.safeParse(schema);
306
- expect(result.success).toBe(true);
307
- });
308
- });
309
- });
310
- //# sourceMappingURL=schema-object.test.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/schemas/3.1/processed/schema-object.test.ts"],
4
- "sourcesContent": ["import { describe, expect, it } from 'vitest'\nimport { SchemaObjectSchema } from './schema-object'\n\ndescribe('schema-object', () => {\n describe('basic validation', () => {\n it('validates a simple string schema', () => {\n const schema = {\n type: 'string',\n minLength: 1,\n maxLength: 100,\n pattern: '^[a-zA-Z]+$',\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates a complex object schema', () => {\n const schema = {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n format: 'uuid',\n },\n name: {\n type: 'string',\n minLength: 1,\n },\n age: {\n type: 'integer',\n minimum: 0,\n maximum: 150,\n },\n tags: {\n type: 'array',\n items: {\n type: 'string',\n },\n uniqueItems: true,\n },\n },\n required: ['id', 'name'],\n additionalProperties: false,\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates array type with tuple validation', () => {\n const schema = {\n type: 'array',\n items: {\n type: ['string', 'number'],\n },\n minItems: 2,\n maxItems: 5,\n uniqueItems: true,\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates schema with null type', () => {\n const schema = {\n type: ['string', 'null'],\n description: 'A nullable string field',\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n })\n\n describe('format compatibility', () => {\n it('validates string formats with string type', () => {\n const stringFormats = [\n 'date',\n 'date-time',\n 'duration',\n 'password',\n 'byte',\n 'binary',\n 'email',\n 'uuid',\n 'uri',\n 'uri-reference',\n 'uri-template',\n 'hostname',\n 'ipv4',\n 'ipv6',\n ]\n\n stringFormats.forEach((format) => {\n const schema = {\n type: 'string',\n format,\n }\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n })\n\n it('validates number formats with numeric types', () => {\n const numberFormats = ['float', 'double', 'int32', 'int64']\n\n numberFormats.forEach((format) => {\n const schema = {\n type: 'number',\n format,\n }\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n })\n })\n\n describe('discriminator validation', () => {\n it('validates discriminator with oneOf', () => {\n const schema = {\n oneOf: [\n { type: 'object', properties: { type: { const: 'dog' } } },\n { type: 'object', properties: { type: { const: 'cat' } } },\n ],\n discriminator: {\n propertyName: 'type',\n },\n required: ['type'],\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates discriminator with anyOf', () => {\n const schema = {\n anyOf: [\n { type: 'object', properties: { type: { const: 'dog' } } },\n { type: 'object', properties: { type: { const: 'cat' } } },\n ],\n discriminator: {\n propertyName: 'type',\n },\n required: ['type'],\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates discriminator with mapping', () => {\n const schema = {\n oneOf: [\n { type: 'object', properties: { type: { const: 'dog' } } },\n { type: 'object', properties: { type: { const: 'cat' } } },\n ],\n discriminator: {\n propertyName: 'type',\n mapping: {\n dog: '#/components/schemas/Dog',\n cat: '#/components/schemas/Cat',\n },\n },\n required: ['type'],\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n })\n\n describe('metadata validation', () => {\n it('validates vendor extensions', () => {\n const schema = {\n type: 'string',\n 'x-custom-extension': true,\n 'x-another-extension': {\n nested: 'value',\n },\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n })\n\n describe('format validation', () => {\n it('validates date format', () => {\n const schema = {\n type: 'string',\n format: 'date',\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates email format', () => {\n const schema = {\n type: 'string',\n format: 'email',\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates uuid format', () => {\n const schema = {\n type: 'string',\n format: 'uuid',\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates int32 format', () => {\n const schema = {\n type: 'integer',\n format: 'int32',\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n })\n\n describe('OpenAPI extensions', () => {\n it('validates xml configuration', () => {\n const schema = {\n type: 'object',\n xml: {\n name: 'Pet',\n namespace: 'http://example.com/schema',\n prefix: 'p',\n attribute: true,\n wrapped: true,\n },\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates external documentation', () => {\n const schema = {\n type: 'object',\n externalDocs: {\n description: 'Find more info here',\n url: 'https://example.com/docs',\n },\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates custom x- extensions', () => {\n const schema = {\n type: 'string',\n 'x-custom-extension': {\n someValue: 123,\n },\n 'x-another-extension': true,\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n })\n\n describe('schema composition', () => {\n it('validates allOf composition', () => {\n const schema = {\n allOf: [\n { type: 'object', properties: { name: { type: 'string' } } },\n { type: 'object', properties: { age: { type: 'integer' } } },\n ],\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates oneOf with discriminator', () => {\n const schema = {\n oneOf: [\n { type: 'object', properties: { type: { const: 'dog' }, bark: { type: 'boolean' } } },\n { type: 'object', properties: { type: { const: 'cat' }, meow: { type: 'boolean' } } },\n ],\n discriminator: {\n propertyName: 'type',\n },\n required: ['type'],\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates anyOf with multiple types', () => {\n const schema = {\n anyOf: [{ type: 'string', format: 'email' }, { type: 'string', format: 'uri' }, { type: 'null' }],\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n\n it('validates not with complex schema', () => {\n const schema = {\n not: {\n type: 'object',\n properties: {\n forbidden: { type: 'boolean', const: true },\n restricted: { type: 'string', enum: ['no', 'nope'] },\n },\n required: ['forbidden'],\n },\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true)\n })\n })\n\n describe('validation errors', () => {\n it('rejects invalid type values', () => {\n const schema = { type: 'invalid' }\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(false)\n if (!result.success) {\n expect(result.error.issues[0].path).toContain('type')\n }\n })\n\n it('rejects invalid required fields', () => {\n const schema = {\n type: 'object',\n properties: {\n name: { type: 'string' },\n },\n required: ['age'], // age is not defined in properties\n }\n\n const result = SchemaObjectSchema.safeParse(schema)\n expect(result.success).toBe(true) // OpenAPI allows this as properties might be defined elsewhere\n })\n })\n})\n"],
5
- "mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AACrC,SAAS,0BAA0B;AAEnC,SAAS,iBAAiB,MAAM;AAC9B,WAAS,oBAAoB,MAAM;AACjC,OAAG,oCAAoC,MAAM;AAC3C,YAAM,SAAS;AAAA,QACb,MAAM;AAAA,QACN,WAAW;AAAA,QACX,WAAW;AAAA,QACX,SAAS;AAAA,MACX;AAEA,YAAM,SAAS,mBAAmB,UAAU,MAAM;AAClD,aAAO,OAAO,OAAO,EAAE,KAAK,IAAI;AAAA,IAClC,CAAC;AAED,OAAG,qCAAqC,MAAM;AAC5C,YAAM,SAAS;AAAA,QACb,MAAM;AAAA,QACN,YAAY;AAAA,UACV,IAAI;AAAA,YACF,MAAM;AAAA,YACN,QAAQ;AAAA,UACV;AAAA,UACA,MAAM;AAAA,YACJ,MAAM;AAAA,YACN,WAAW;AAAA,UACb;AAAA,UACA,KAAK;AAAA,YACH,MAAM;AAAA,YACN,SAAS;AAAA,YACT,SAAS;AAAA,UACX;AAAA,UACA,MAAM;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,cACL,MAAM;AAAA,YACR;AAAA,YACA,aAAa;AAAA,UACf;AAAA,QACF;AAAA,QACA,UAAU,CAAC,MAAM,MAAM;AAAA,QACvB,sBAAsB;A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,MAAM,UAAU;AACjC,YAAM,SAAS,mBAAmB,UAAU,MAAM;AAClD,aAAO,OAAO,OAAO,EAAE,KAAK,KAAK;AACjC,UAAI,CAAC,OAAO,SAAS;AACnB,eAAO,OAAO,MAAM,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,MAAM;AAAA,MACtD;AAAA,IACF,CAAC;AAED,OAAG,mCAAmC,MAAM;AAC1C,YAAM,SAAS;AAAA,QACb,MAAM;AAAA,QACN,YAAY;AAAA,UACV,MAAM,EAAE,MAAM,SAAS;AAAA,QACzB;AAAA,QACA,UAAU,CAAC,KAAK;AAAA;AAAA,MAClB;AAEA,YAAM,SAAS,mBAAmB,UAAU,MAAM;AAClD,aAAO,OAAO,OAAO,EAAE,KAAK,IAAI;AAAA,IAClC,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
6
- "names": []
7
- }
@@ -1,28 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { XAdditionalPropertiesNameSchema } from "./x-additional-properties-name.js";
3
- describe("XAdditionalPropertiesNameSchema", () => {
4
- it("accepts a valid additional properties name", () => {
5
- const result = XAdditionalPropertiesNameSchema.parse({
6
- "x-additionalPropertiesName": "customField"
7
- });
8
- expect(result).toEqual({
9
- "x-additionalPropertiesName": "customField"
10
- });
11
- });
12
- it("defaults to undefined when empty", () => {
13
- const result = XAdditionalPropertiesNameSchema.parse({});
14
- expect(result).toEqual({
15
- "x-additionalPropertiesName": void 0
16
- });
17
- });
18
- it("defaults to undefined when invalid type is provided", () => {
19
- const result = XAdditionalPropertiesNameSchema.parse({
20
- "x-additionalPropertiesName": 123
21
- // Invalid type - should be string
22
- });
23
- expect(result).toEqual({
24
- "x-additionalPropertiesName": void 0
25
- });
26
- });
27
- });
28
- //# sourceMappingURL=x-additional-properties-name.test.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/schemas/extensions/x-additional-properties-name.test.ts"],
4
- "sourcesContent": ["import { describe, expect, it } from 'vitest'\nimport { XAdditionalPropertiesNameSchema } from './x-additional-properties-name'\n\ndescribe('XAdditionalPropertiesNameSchema', () => {\n it('accepts a valid additional properties name', () => {\n const result = XAdditionalPropertiesNameSchema.parse({\n 'x-additionalPropertiesName': 'customField',\n })\n\n expect(result).toEqual({\n 'x-additionalPropertiesName': 'customField',\n })\n })\n\n it('defaults to undefined when empty', () => {\n const result = XAdditionalPropertiesNameSchema.parse({})\n expect(result).toEqual({\n 'x-additionalPropertiesName': undefined,\n })\n })\n\n it('defaults to undefined when invalid type is provided', () => {\n const result = XAdditionalPropertiesNameSchema.parse({\n 'x-additionalPropertiesName': 123, // Invalid type - should be string\n })\n expect(result).toEqual({\n 'x-additionalPropertiesName': undefined,\n })\n })\n})\n"],
5
- "mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AACrC,SAAS,uCAAuC;AAEhD,SAAS,mCAAmC,MAAM;AAChD,KAAG,8CAA8C,MAAM;AACrD,UAAM,SAAS,gCAAgC,MAAM;AAAA,MACnD,8BAA8B;AAAA,IAChC,CAAC;AAED,WAAO,MAAM,EAAE,QAAQ;AAAA,MACrB,8BAA8B;AAAA,IAChC,CAAC;AAAA,EACH,CAAC;AAED,KAAG,oCAAoC,MAAM;AAC3C,UAAM,SAAS,gCAAgC,MAAM,CAAC,CAAC;AACvD,WAAO,MAAM,EAAE,QAAQ;AAAA,MACrB,8BAA8B;AAAA,IAChC,CAAC;AAAA,EACH,CAAC;AAED,KAAG,uDAAuD,MAAM;AAC9D,UAAM,SAAS,gCAAgC,MAAM;AAAA,MACnD,8BAA8B;AAAA;AAAA,IAChC,CAAC;AACD,WAAO,MAAM,EAAE,QAAQ;AAAA,MACrB,8BAA8B;AAAA,IAChC,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
6
- "names": []
7
- }