Skip to content

Commit 1e10aac

Browse files
committed
chore(test): latest snapshots
1 parent c1e5be0 commit 1e10aac

2 files changed

Lines changed: 120 additions & 130 deletions

File tree

__tests__/__snapshots__/json-schema.test.ts.snap

Lines changed: 20 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,16 @@ exports[`Example > JSON Schema snapshot 1`] = `
2626
"$ref": "#/components/schemas/Address",
2727
},
2828
"age": {
29-
"format": "int32",
30-
"minimum": 0,
31-
"type": "integer",
29+
"anyOf": [
30+
{
31+
"format": "int32",
32+
"minimum": 0,
33+
"type": "integer",
34+
},
35+
{
36+
"type": "null",
37+
},
38+
],
3239
},
3340
"name": {
3441
"type": "string",
@@ -67,103 +74,16 @@ exports[`Example > JSON Schema snapshot 1`] = `
6774
"$ref": "#/components/schemas/Address",
6875
},
6976
"age": {
70-
"format": "int32",
71-
"minimum": 0,
72-
"type": "integer",
73-
},
74-
"name": {
75-
"type": "string",
76-
},
77-
"userId": {
78-
"$ref": "#/components/schemas/Id",
79-
},
80-
},
81-
"required": [
82-
"name",
83-
],
84-
"type": "object",
85-
},
86-
"Users": {
87-
"items": {
88-
"$ref": "#/components/schemas/User",
89-
},
90-
"type": "array",
91-
"uniqueItems": true,
92-
},
93-
},
94-
}
95-
`;
96-
97-
exports[`JSON Schema snapshot 1`] = `
98-
{
99-
"$schema": "http://json-schema.org/draft-07/schema#",
100-
"definitions": {
101-
"Address": {
102-
"additionalProperties": false,
103-
"properties": {
104-
"postcode": {
105-
"format": "int32",
106-
"maximum": 9999,
107-
"minimum": 1000,
108-
"type": "integer",
109-
},
110-
},
111-
"required": [
112-
"name",
113-
],
114-
"type": "object",
115-
},
116-
"CreateUserRequest": {
117-
"additionalProperties": false,
118-
"properties": {
119-
"address": {
120-
"$ref": "#/components/schemas/Address",
121-
},
122-
"age": {
123-
"format": "int32",
124-
"minimum": 0,
125-
"type": "integer",
126-
},
127-
"name": {
128-
"type": "string",
129-
},
130-
"userId": {
131-
"$ref": "#/components/schemas/Id",
132-
},
133-
},
134-
"required": [
135-
"name",
136-
],
137-
"type": "object",
138-
},
139-
"Id": {
140-
"type": "string",
141-
},
142-
"UpdateUserRequest": {
143-
"additionalProperties": false,
144-
"minProperties": 1,
145-
"properties": {
146-
"address": {
147-
"$ref": "#/components/schemas/Address",
148-
},
149-
"age": {
150-
"format": "int32",
151-
"minimum": 0,
152-
"type": "integer",
153-
},
154-
},
155-
"type": "object",
156-
},
157-
"User": {
158-
"additionalProperties": false,
159-
"properties": {
160-
"address": {
161-
"$ref": "#/components/schemas/Address",
162-
},
163-
"age": {
164-
"format": "int32",
165-
"minimum": 0,
166-
"type": "integer",
77+
"anyOf": [
78+
{
79+
"format": "int32",
80+
"minimum": 0,
81+
"type": "integer",
82+
},
83+
{
84+
"type": "null",
85+
},
86+
],
16787
},
16888
"name": {
16989
"type": "string",

__tests__/__snapshots__/openapi-schema.test.ts.snap

Lines changed: 100 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,16 @@ exports[`Example > OpenAPI 1`] = `
3636
"$ref": "#/components/schemas/Address",
3737
},
3838
"age": {
39-
"format": "int32",
40-
"minimum": 0,
41-
"type": "integer",
39+
"anyOf": [
40+
{
41+
"format": "int32",
42+
"minimum": 0,
43+
"type": "integer",
44+
},
45+
{
46+
"type": "null",
47+
},
48+
],
4249
},
4350
"name": {
4451
"type": "string",
@@ -77,9 +84,16 @@ exports[`Example > OpenAPI 1`] = `
7784
"$ref": "#/components/schemas/Address",
7885
},
7986
"age": {
80-
"format": "int32",
81-
"minimum": 0,
82-
"type": "integer",
87+
"anyOf": [
88+
{
89+
"format": "int32",
90+
"minimum": 0,
91+
"type": "integer",
92+
},
93+
{
94+
"type": "null",
95+
},
96+
],
8397
},
8498
"name": {
8599
"type": "string",
@@ -297,9 +311,16 @@ exports[`Example > Swagger Parser validate 1`] = `
297311
"type": "object",
298312
},
299313
"age": {
300-
"format": "int32",
301-
"minimum": 0,
302-
"type": "integer",
314+
"anyOf": [
315+
{
316+
"format": "int32",
317+
"minimum": 0,
318+
"type": "integer",
319+
},
320+
{
321+
"type": "null",
322+
},
323+
],
303324
},
304325
"name": {
305326
"type": "string",
@@ -362,9 +383,16 @@ exports[`Example > Swagger Parser validate 1`] = `
362383
"type": "object",
363384
},
364385
"age": {
365-
"format": "int32",
366-
"minimum": 0,
367-
"type": "integer",
386+
"anyOf": [
387+
{
388+
"format": "int32",
389+
"minimum": 0,
390+
"type": "integer",
391+
},
392+
{
393+
"type": "null",
394+
},
395+
],
368396
},
369397
"name": {
370398
"type": "string",
@@ -398,9 +426,16 @@ exports[`Example > Swagger Parser validate 1`] = `
398426
"type": "object",
399427
},
400428
"age": {
401-
"format": "int32",
402-
"minimum": 0,
403-
"type": "integer",
429+
"anyOf": [
430+
{
431+
"format": "int32",
432+
"minimum": 0,
433+
"type": "integer",
434+
},
435+
{
436+
"type": "null",
437+
},
438+
],
404439
},
405440
"name": {
406441
"type": "string",
@@ -459,9 +494,16 @@ exports[`Example > Swagger Parser validate 1`] = `
459494
"type": "object",
460495
},
461496
"age": {
462-
"format": "int32",
463-
"minimum": 0,
464-
"type": "integer",
497+
"anyOf": [
498+
{
499+
"format": "int32",
500+
"minimum": 0,
501+
"type": "integer",
502+
},
503+
{
504+
"type": "null",
505+
},
506+
],
465507
},
466508
"name": {
467509
"type": "string",
@@ -511,9 +553,16 @@ exports[`Example > Swagger Parser validate 1`] = `
511553
"type": "object",
512554
},
513555
"age": {
514-
"format": "int32",
515-
"minimum": 0,
516-
"type": "integer",
556+
"anyOf": [
557+
{
558+
"format": "int32",
559+
"minimum": 0,
560+
"type": "integer",
561+
},
562+
{
563+
"type": "null",
564+
},
565+
],
517566
},
518567
"name": {
519568
"type": "string",
@@ -555,9 +604,16 @@ exports[`Example > Swagger Parser validate 1`] = `
555604
"type": "object",
556605
},
557606
"age": {
558-
"format": "int32",
559-
"minimum": 0,
560-
"type": "integer",
607+
"anyOf": [
608+
{
609+
"format": "int32",
610+
"minimum": 0,
611+
"type": "integer",
612+
},
613+
{
614+
"type": "null",
615+
},
616+
],
561617
},
562618
"name": {
563619
"type": "string",
@@ -625,9 +681,16 @@ exports[`Example > Swagger Parser validate 1`] = `
625681
"type": "object",
626682
},
627683
"age": {
628-
"format": "int32",
629-
"minimum": 0,
630-
"type": "integer",
684+
"anyOf": [
685+
{
686+
"format": "int32",
687+
"minimum": 0,
688+
"type": "integer",
689+
},
690+
{
691+
"type": "null",
692+
},
693+
],
631694
},
632695
"name": {
633696
"type": "string",
@@ -724,9 +787,16 @@ exports[`Example > Swagger Parser validate 1`] = `
724787
"type": "object",
725788
},
726789
"age": {
727-
"format": "int32",
728-
"minimum": 0,
729-
"type": "integer",
790+
"anyOf": [
791+
{
792+
"format": "int32",
793+
"minimum": 0,
794+
"type": "integer",
795+
},
796+
{
797+
"type": "null",
798+
},
799+
],
730800
},
731801
"name": {
732802
"type": "string",

0 commit comments

Comments
 (0)