forked from swagger-api/swagger-codegen-generators
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request swagger-api#580 from swagger-api/model_named_file
allow models named file and other utils default java classes.
- Loading branch information
Showing
10 changed files
with
336 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/test/java/io/swagger/codegen/v3/generators/AbstractCodegenTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.swagger.codegen.v3.generators; | ||
|
||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.parser.OpenAPIV3Parser; | ||
import io.swagger.v3.parser.core.models.ParseOptions; | ||
import io.swagger.v3.parser.core.models.SwaggerParseResult; | ||
|
||
public abstract class AbstractCodegenTest { | ||
|
||
protected OpenAPI getOpenAPI(String filePath) { | ||
OpenAPIV3Parser openApiParser = new OpenAPIV3Parser(); | ||
ParseOptions options = new ParseOptions(); | ||
options.setResolve(true); | ||
options.setFlatten(true); | ||
SwaggerParseResult parseResult = openApiParser.readLocation(filePath, null, options); | ||
|
||
return parseResult.getOpenAPI(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.