Skip to content

Commit 787d1b5

Browse files
authored
Merge pull request #1198 from swagger-api/revert-1197-issue-1196
Revert "Issue#1196 Fix OpenAPIV3Parser.readContents() encoding error"
2 parents b59b475 + de2253c commit 787d1b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/OpenAPIV3Parser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ public SwaggerParseResult readContents(String swaggerAsString, List<Authorizatio
183183
if(options != null) {
184184
if (options.isResolve()) {
185185
OpenAPIDeserializer deserializer = new OpenAPIDeserializer();
186-
JsonNode rootNode = mapper.readTree(swaggerAsString);
186+
JsonNode rootNode = mapper.readTree(swaggerAsString.getBytes());
187187
result = deserializer.deserialize(rootNode);
188188
OpenAPIResolver resolver = new OpenAPIResolver(result.getOpenAPI(), auth, null);
189189
result.setOpenAPI(resolver.resolve());
190190
}else{
191-
JsonNode rootNode = mapper.readTree(swaggerAsString);
191+
JsonNode rootNode = mapper.readTree(swaggerAsString.getBytes());
192192
result = new OpenAPIDeserializer().deserialize(rootNode);
193193
}
194194
if (options.isResolveFully()) {
@@ -200,7 +200,7 @@ public SwaggerParseResult readContents(String swaggerAsString, List<Authorizatio
200200
inlineModelResolver.flatten(result.getOpenAPI());
201201
}
202202
}else{
203-
JsonNode rootNode = mapper.readTree(swaggerAsString);
203+
JsonNode rootNode = mapper.readTree(swaggerAsString.getBytes());
204204
result = new OpenAPIDeserializer().deserialize(rootNode);
205205
}
206206
} catch (Exception e) {

0 commit comments

Comments
 (0)