File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
modules/swagger-generator/src/main/java/com/wordnik/swagger/generator/online Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,22 @@ public class Generator {
22
22
static Logger LOGGER = LoggerFactory .getLogger (Generator .class );
23
23
24
24
public static String generateClient (String language , GeneratorInput opts ) throws ApiException {
25
+ Swagger swagger ;
25
26
LOGGER .debug ("generate client for " + language );
26
27
if (opts == null ) {
27
28
throw new BadRequestException (400 , "No options were supplied" );
28
29
}
29
30
JsonNode node = opts .getSpec ();
30
31
if (node == null ) {
31
- throw new BadRequestException (400 , "No swagger specification was supplied" );
32
+ if (opts .getSwaggerUrl () != null ) {
33
+ swagger = new SwaggerParser ().read (opts .getSwaggerUrl ());
34
+ }
35
+ else
36
+ throw new BadRequestException (400 , "No swagger specification was supplied" );
37
+ }
38
+ else {
39
+ swagger = new SwaggerParser ().read (node );
32
40
}
33
- Swagger swagger = new SwaggerParser ().read (node );
34
41
if (swagger == null ) {
35
42
throw new BadRequestException (400 , "The swagger specification supplied was not valid" );
36
43
}
You can’t perform that action at this time.
0 commit comments