Update validate command (#338)

This commit is contained in:
Akihito Nakano
2018-05-06 22:02:16 +09:00
committed by GitHub
parent 4d3110f29d
commit a56d2333a2

View File

@@ -3,8 +3,8 @@ package org.openapitools.codegen.cmd;
import io.airlift.airline.Command;
import io.airlift.airline.Option;
import io.swagger.parser.SwaggerParser;
import io.swagger.parser.util.SwaggerDeserializationResult;
import io.swagger.parser.OpenAPIParser;
import io.swagger.v3.parser.core.models.SwaggerParseResult;
import java.util.HashSet;
import java.util.List;
@@ -21,8 +21,7 @@ public class Validate implements Runnable {
public void run() {
System.out.println("Validating spec file (" + spec + ")");
SwaggerParser parser = new SwaggerParser();
SwaggerDeserializationResult result = parser.readWithInfo(spec, null, true);
SwaggerParseResult result = new OpenAPIParser().readLocation(spec, null, null);
List<String> messageList = result.getMessages();
Set<String> messages = new HashSet<String>(messageList);