Skip to content

Commit

Permalink
fixes #173 upgrade to new openapi-parser API in openapi generator
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehu committed Sep 5, 2018
1 parent add7cc9 commit 3ffd33a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
import com.jsoniter.output.JsonStream;
import com.networknt.codegen.Generator;
import com.networknt.codegen.Utils;
import com.networknt.jsonoverlay.Overlay;
import com.networknt.oas.OpenApiParser;
import com.networknt.oas.model.*;
import com.networknt.oas.model.impl.OpenApi3Impl;

import java.io.ByteArrayInputStream;
import java.io.IOException;
Expand Down Expand Up @@ -154,7 +156,7 @@ public void generate(String targetPath, Object model, Any config) throws IOExcep
} catch (MalformedURLException e) {
throw new RuntimeException("Failed to parse the model", e);
}
anyComponents = JsonIterator.deserialize(openApi3.toJson().toString()).get("components");
anyComponents = JsonIterator.deserialize(Overlay.toJson((OpenApi3Impl)openApi3).toString()).get("components");
} else {
throw new RuntimeException("Invalid Model Class: " + model.getClass());
}
Expand Down

0 comments on commit 3ffd33a

Please sign in to comment.