File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
packages/zod-openapi/src/lib Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -977,7 +977,7 @@ describe('zodOpenapi', () => {
977
977
type : [ 'string' , 'null' ] ,
978
978
} ,
979
979
} ,
980
- type : 'object' ,
980
+ type : [ 'object' ] ,
981
981
} ) ;
982
982
const schema2 = z . object ( {
983
983
item : extendApi (
@@ -988,11 +988,11 @@ describe('zodOpenapi', () => {
988
988
expect ( generateSchema ( schema2 ) ) . toEqual ( {
989
989
properties : {
990
990
item : {
991
- type : 'string' ,
991
+ type : [ 'string' ] ,
992
992
} ,
993
993
} ,
994
994
required : [ 'item' ] ,
995
- type : 'object' ,
995
+ type : [ 'object' ] ,
996
996
} ) ;
997
997
998
998
} ) ;
@@ -1003,13 +1003,17 @@ describe('zodOpenapi', () => {
1003
1003
Object {
1004
1004
"properties": Object {
1005
1005
"field": Object {
1006
- "type": "string",
1006
+ "type": Array [
1007
+ "string",
1008
+ ],
1007
1009
},
1008
1010
},
1009
1011
"required": Array [
1010
1012
"field",
1011
1013
],
1012
- "type": "object",
1014
+ "type": Array [
1015
+ "object",
1016
+ ],
1013
1017
}
1014
1018
` ) ;
1015
1019
@@ -1018,13 +1022,17 @@ describe('zodOpenapi', () => {
1018
1022
Object {
1019
1023
"properties": Object {
1020
1024
"field": Object {
1021
- "type": "string",
1025
+ "type": Array [
1026
+ "string",
1027
+ ],
1022
1028
},
1023
1029
},
1024
1030
"required": Array [
1025
1031
"field",
1026
1032
],
1027
- "type": "object",
1033
+ "type": Array [
1034
+ "object",
1035
+ ],
1028
1036
}
1029
1037
` ) ;
1030
1038
You can’t perform that action at this time.
0 commit comments