File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
modules/swagger-core/src/test/java/io/swagger/v3/core/serialization Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 17
17
import io .swagger .v3 .oas .models .media .Schema ;
18
18
import io .swagger .v3 .oas .models .media .StringSchema ;
19
19
import org .testng .annotations .Test ;
20
+ import org .json .JSONObject ;
21
+ import org .skyscreamer .jsonassert .JSONAssert ;
20
22
21
23
import java .io .IOException ;
22
24
import java .math .BigDecimal ;
@@ -110,7 +112,11 @@ public void deserializeModel() throws IOException {
110
112
public void serializeArrayModel () throws IOException {
111
113
final ArraySchema model = new ArraySchema ();
112
114
model .setItems (new Schema ().$ref ("Pet" ));
113
- assertEquals (m .writeValueAsString (model ), "{\" type\" :\" array\" ,\" items\" :{\" $ref\" :\" #/components/schemas/Pet\" }}" );
115
+ String json1 = m .writeValueAsString (model );
116
+ String json2 = "{\" type\" :\" array\" ,\" items\" :{\" $ref\" :\" #/components/schemas/Pet\" }}" ;
117
+ JSONObject jsonObj1 = new JSONObject (json1 );
118
+ JSONObject jsonObj2 = new JSONObject (json2 );
119
+ JSONAssert .assertEquals (jsonObj1 , jsonObj2 , true );
114
120
}
115
121
116
122
@ Test (description = "it should deserialize an array model" )
You can’t perform that action at this time.
0 commit comments