File tree 1 file changed +28
-9
lines changed
1 file changed +28
-9
lines changed Original file line number Diff line number Diff line change @@ -74,17 +74,26 @@ test('remove readOnly', function(assert) {
74
74
assert . plan ( 1 ) ;
75
75
76
76
schema = {
77
- type : 'string' ,
78
- readOnly : true
77
+ type : 'object' ,
78
+ properties : {
79
+ readOnly : {
80
+ type : 'string' ,
81
+ readOnly : true
82
+ }
83
+ }
79
84
} ;
80
85
81
86
result = convert ( schema ) ;
82
87
83
88
expected = {
84
89
$schema : 'http://json-schema.org/draft-04/schema#' ,
85
- type : 'string'
90
+ type : 'object' ,
91
+ properties : {
92
+ readOnly : {
93
+ type : 'string'
94
+ }
95
+ }
86
96
} ;
87
-
88
97
assert . deepEqual ( result , expected , 'readOnly removed' ) ;
89
98
} ) ;
90
99
@@ -97,17 +106,27 @@ test('remove writeOnly', function(assert) {
97
106
assert . plan ( 1 ) ;
98
107
99
108
schema = {
100
- type : 'string' ,
101
- format : 'password' ,
102
- writeOnly : true
109
+ type : 'object' ,
110
+ properties : {
111
+ test : {
112
+ type : 'string' ,
113
+ format : 'password' ,
114
+ writeOnly : true
115
+ }
116
+ }
103
117
} ;
104
118
105
119
result = convert ( schema ) ;
106
120
107
121
expected = {
108
122
$schema : 'http://json-schema.org/draft-04/schema#' ,
109
- type : 'string' ,
110
- format : 'password'
123
+ type : 'object' ,
124
+ properties : {
125
+ test : {
126
+ type : 'string' ,
127
+ format : 'password'
128
+ }
129
+ }
111
130
} ;
112
131
113
132
assert . deepEqual ( result , expected , 'writeOnly removed' ) ;
You can’t perform that action at this time.
0 commit comments