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
@Test | |
public void fieldsUseLowerCaseCamel() { | |
String schema = readFileToString(new File(getClass().getResource("/schema.json").getPath()), Charset.forName("UTF-8")); | |
Swagger swagger = new SwaggerParser().parse(schema); | |
for (Map.Entry<String, Model> entry : swagger.getDefinitions().entrySet()) { | |
if (entry.getValue().getProperties() == null) { | |
continue; | |
} | |
for (String fieldName : entry.getValue().getProperties().keySet()) { |
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
{{#vendorExtensions.x-enum-definition}}{{.}}{{/vendorExtensions.x-enum-definition}} | |
{{^vendorExtensions.x-enum-definition}}{{{dataType}}}{{/vendorExtensions.x-enum-definition}} |
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
{ | |
"name": "account_type", | |
"in": "query", | |
"required": false, | |
"type": "string", | |
"enum": [ | |
"PERSONAL", | |
"COLLEGE_SAVING" | |
], | |
"x-enum-definition": "AccountType" |
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
public class V1Api { | |
@Inject V1ApiService delegate; | |
@GET | |
@Path("/v1/account") | |
public AccountInfo getAccountInfo(@ApiParam(required=true) @QueryParam("account_id") String accountId, @ApiParam(required=false) @QueryParam("account_type") String accountType) { | |
return delegate.getAccountInfo(accountId); | |
} | |
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
{ | |
"name": "account_type", | |
"in": "query", | |
"required": false, | |
"type": "string", | |
"enum": [ | |
"PERSONAL", | |
"COLLEGE_SAVING" | |
] | |
} |
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
public enum {{{classname}}} { | |
{{#allowableValues}} | |
{{#values}}{{.}},{{/values}} | |
{{/allowableValues}} | |
@JsonEnumDefaultValue | |
ENUM_DEFAULT_VALUE | |
} |
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
{{#model}} | |
public static class Builder { | |
{{#vars}} | |
private {{{datatypeWithEnum}}} {{name}}; | |
{{/vars}} | |
{{#vars}} | |
public Builder {{name}}({{{datatypeWithEnum}}} {{name}}) { | |
this.{{name}} = {{name}}; | |
return this; |
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
public static class Builder { | |
private AccountType accountType; | |
public Builder accountType(AccountType accountType) { | |
this.accountType = accountType; | |
return this; | |
} | |
public AccountInfo build() { |
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
public class V1Api { | |
@Inject V1ApiService delegate; | |
@GET | |
@Path("/v1/account") | |
public AccountInfo getAccountInfo(@ApiParam(required=true) @QueryParam("account_id") String accountId) { | |
assertNotNull(accountId); // null check generated for all required parameters | |
return delegate.getAccountInfo(accountId); | |
} |
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
public class V1Api { | |
@Inject V1ApiService delegate; | |
@GET | |
@Path("/v1/account") | |
public AccountInfo getAccountInfo(@ApiParam(required=true) @QueryParam("account_id") String accountId) { | |
return delegate.getAccountInfo(accountId); | |
} | |
NewerOlder