Skip to content

Instantly share code, notes, and snippets.

{
"swagger": "2.0",
"paths": {
"/v1/account": {
"get": {
"description": "Get account information by account id.",
"operationId": "getAccountInfo",
"parameters": [
{
"name": "account_id",
"parameters": [
{
"name": "account_id",
"in": "query",
"required": true,
"type": "string"
}
]
{{#required}}assertNotNull({{paramName}});{{/required}}
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);
}
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);
}
public static class Builder {
private AccountType accountType;
public Builder accountType(AccountType accountType) {
this.accountType = accountType;
return this;
}
public AccountInfo build() {
{{#model}}
public static class Builder {
{{#vars}}
private {{{datatypeWithEnum}}} {{name}};
{{/vars}}
{{#vars}}
public Builder {{name}}({{{datatypeWithEnum}}} {{name}}) {
this.{{name}} = {{name}};
return this;
public enum {{{classname}}} {
{{#allowableValues}}
{{#values}}{{.}},{{/values}}
{{/allowableValues}}
@JsonEnumDefaultValue
ENUM_DEFAULT_VALUE
}
{
"name": "account_type",
"in": "query",
"required": false,
"type": "string",
"enum": [
"PERSONAL",
"COLLEGE_SAVING"
]
}
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);
}