diff --git a/raml-client-generator-core/src/main/java/org/mule/client/codegen/utils/SecuritySchemesHelper.java b/raml-client-generator-core/src/main/java/org/mule/client/codegen/utils/SecuritySchemesHelper.java index 0ced234..53908e2 100644 --- a/raml-client-generator-core/src/main/java/org/mule/client/codegen/utils/SecuritySchemesHelper.java +++ b/raml-client-generator-core/src/main/java/org/mule/client/codegen/utils/SecuritySchemesHelper.java @@ -31,6 +31,12 @@ public static List> getSupportedSecuritySchemes(Api supportedSecuritySchemes.add(new ImmutablePair<>(schemeMap.getType(), schemeMap)); } } + List securedBy = raml.getSecuredBy(); + for (SecurityScheme securedBySecurityScheme : securedBy) { + if (SUPPORTED_SECURITY_SCHEMES.contains(securedBySecurityScheme.getType())) { + supportedSecuritySchemes.add(new ImmutablePair<>(securedBySecurityScheme.getType(), securedBySecurityScheme)); + } + } return supportedSecuritySchemes; } diff --git a/raml-client-generator-core/src/test/java/org/mule/client/codegen/RamlJavaClientGeneratorTest.java b/raml-client-generator-core/src/test/java/org/mule/client/codegen/RamlJavaClientGeneratorTest.java index 5affc22..85da9ad 100644 --- a/raml-client-generator-core/src/test/java/org/mule/client/codegen/RamlJavaClientGeneratorTest.java +++ b/raml-client-generator-core/src/test/java/org/mule/client/codegen/RamlJavaClientGeneratorTest.java @@ -51,6 +51,7 @@ public static Iterable folders() { {"oauth_override"}, {"recursive_type"}, {"simple"}, + {"securedby_with_uses"}, {"sub_resource_on_same_line"}, {"same_path_multiple_times"}, {"type_decl"}, diff --git a/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/api.raml b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/api.raml new file mode 100644 index 0000000..1723944 --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/api.raml @@ -0,0 +1,28 @@ +#%RAML 1.0 +version: api +title: BuyosExperienceLayer +baseUri: http://localhost:24045/api + +uses: + candaCommons: canda-commons/1.0.8/canda-commons.raml + +securedBy: [candaCommons.basicAuth] + +# Workaround as https://github.com/mulesoft-labs/raml-java-client-generator +# does not detect securitySchemes placed in the "uses" section. +#securitySchemes: +# clientid: +# description: Client ID Policy +# type: Basic Authentication + +#securedBy: [clientid] + +/users/{id}: + get: + responses: + 200: + body: + application/json: + example: | + { "userId": "foo" } + diff --git a/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/canda-commons/1.0.8/canda-commons.raml b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/canda-commons/1.0.8/canda-commons.raml new file mode 100644 index 0000000..5ec3962 --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/canda-commons/1.0.8/canda-commons.raml @@ -0,0 +1,15 @@ +#%RAML 1.0 Library + +securitySchemes: + basicAuth: + displayName: Basic Authentication + description: This API supports Basic Authentication. The client has to provide an "Authorization" header with valid credentials. + type: Basic Authentication + describedBy: + headers: + Authorization: + description: Used to send valid credentials. + type: string + responses: + 401: + description: Credentials are missing or could not be validated by the server. diff --git a/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/api/BuyosExperienceLayerClient.java b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/api/BuyosExperienceLayerClient.java new file mode 100644 index 0000000..d20ba20 --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/api/BuyosExperienceLayerClient.java @@ -0,0 +1,44 @@ + +package securedby_with_uses.api; + +import javax.ws.rs.client.ClientBuilder; +import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; +import securedby_with_uses.resource.users.Users; + +public class BuyosExperienceLayerClient { + + private static java.lang.String username; + private static java.lang.String password; + private java.lang.String _baseUrl; + public final Users users; + + public BuyosExperienceLayerClient(java.lang.String baseUrl, java.lang.String username, java.lang.String password) { + this.username = username; + this.password = password; + _baseUrl = baseUrl; + users = new Users(getBaseUri(), getClient()); + } + + public BuyosExperienceLayerClient(java.lang.String username, java.lang.String password) { + this("http://localhost:24045/api", username, password); + } + + protected javax.ws.rs.client.Client getClient() { + final javax.ws.rs.client.Client _client = ClientBuilder.newClient(); + _client.register(HttpAuthenticationFeature.basic(username, password)); + return _client; + } + + protected java.lang.String getBaseUri() { + return _baseUrl; + } + + public static BuyosExperienceLayerClient create(java.lang.String baseUrl, java.lang.String username, java.lang.String password) { + return new BuyosExperienceLayerClient(baseUrl, username, password); + } + + public static BuyosExperienceLayerClient create(java.lang.String username, java.lang.String password) { + return new BuyosExperienceLayerClient(username, password); + } + +} diff --git a/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/exceptions/BuyosExperienceLayerException.java b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/exceptions/BuyosExperienceLayerException.java new file mode 100644 index 0000000..59a3aaa --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/exceptions/BuyosExperienceLayerException.java @@ -0,0 +1,44 @@ + +package securedby_with_uses.exceptions; + +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; + +public class BuyosExperienceLayerException + extends RuntimeException +{ + + private int statusCode; + private String reason; + private MultivaluedMap headers; + private Response response; + + public BuyosExperienceLayerException(int statusCode, String reason, MultivaluedMap headers, Response response) { + super(reason); + this.statusCode = statusCode; + this.reason = reason; + this.headers = headers; + this.response = response; + } + + public BuyosExperienceLayerException(int statusCode, String reason) { + this(statusCode, reason, null, null); + } + + public int getStatusCode() { + return this.statusCode; + } + + public String getReason() { + return this.reason; + } + + public MultivaluedMap getHeaders() { + return this.headers; + } + + public Response getResponse() { + return this.response; + } + +} diff --git a/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/resource/users/Users.java b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/resource/users/Users.java new file mode 100644 index 0000000..91dcc6e --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/resource/users/Users.java @@ -0,0 +1,34 @@ + +package securedby_with_uses.resource.users; + +import javax.ws.rs.client.Client; +import securedby_with_uses.resource.users.id.Id; + +public class Users { + + private String _baseUrl; + private Client _client; + + public Users() { + _baseUrl = null; + _client = null; + } + + public Users(String baseUrl, Client _client) { + _baseUrl = (baseUrl +"/users"); + this._client = _client; + } + + protected Client getClient() { + return this._client; + } + + private String getBaseUri() { + return _baseUrl; + } + + public Id id(String id) { + return new Id(getBaseUri(), getClient(), id); + } + +} diff --git a/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/resource/users/id/Id.java b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/resource/users/id/Id.java new file mode 100644 index 0000000..1b10218 --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/resource/users/id/Id.java @@ -0,0 +1,46 @@ + +package securedby_with_uses.resource.users.id; + +import java.net.URLEncoder; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status.Family; +import securedby_with_uses.exceptions.BuyosExperienceLayerException; + +public class Id { + + private String _baseUrl; + private Client _client; + + public Id() { + _baseUrl = null; + _client = null; + } + + public Id(String baseUrl, Client _client, String uriParam) { + _baseUrl = (baseUrl +("/"+ URLEncoder.encode(uriParam))); + this._client = _client; + } + + protected Client getClient() { + return this._client; + } + + private String getBaseUri() { + return _baseUrl; + } + + public securedby_with_uses.resource.users.id.model.IdGETResponse get() { + WebTarget target = this._client.target(getBaseUri()); + final javax.ws.rs.client.Invocation.Builder invocationBuilder = target.request(MediaType.APPLICATION_JSON_TYPE); + Response response = invocationBuilder.get(); + if (response.getStatusInfo().getFamily()!= Family.SUCCESSFUL) { + Response.StatusType statusInfo = response.getStatusInfo(); + throw new BuyosExperienceLayerException(statusInfo.getStatusCode(), statusInfo.getReasonPhrase(), response.getStringHeaders(), response); + } + return response.readEntity(securedby_with_uses.resource.users.id.model.IdGETResponse.class); + } + +} diff --git a/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/resource/users/id/model/IdGETResponse.java b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/resource/users/id/model/IdGETResponse.java new file mode 100644 index 0000000..e07ec14 --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v1/securedby_with_uses/output/securedby_with_uses/resource/users/id/model/IdGETResponse.java @@ -0,0 +1,110 @@ + +package securedby_with_uses.resource.users.id.model; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "userId" +}) +public class IdGETResponse { + + @JsonProperty("userId") + private String userId; + @JsonIgnore + private Map additionalProperties = new HashMap(); + + /** + * No args constructor for use in serialization + * + */ + public IdGETResponse() { + } + + /** + * + * @param userId + */ + public IdGETResponse(String userId) { + super(); + this.userId = userId; + } + + @JsonProperty("userId") + public String getUserId() { + return userId; + } + + @JsonProperty("userId") + public void setUserId(String userId) { + this.userId = userId; + } + + public IdGETResponse withUserId(String userId) { + this.userId = userId; + return this; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + public IdGETResponse withAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(IdGETResponse.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); + sb.append("userId"); + sb.append('='); + sb.append(((this.userId == null)?"":this.userId)); + sb.append(','); + sb.append("additionalProperties"); + sb.append('='); + sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); + sb.append(','); + if (sb.charAt((sb.length()- 1)) == ',') { + sb.setCharAt((sb.length()- 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.userId == null)? 0 :this.userId.hashCode())); + result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof IdGETResponse) == false) { + return false; + } + IdGETResponse rhs = ((IdGETResponse) other); + return (((this.userId == rhs.userId)||((this.userId!= null)&&this.userId.equals(rhs.userId)))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties)))); + } + +} diff --git a/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/api.raml b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/api.raml new file mode 100644 index 0000000..1723944 --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/api.raml @@ -0,0 +1,28 @@ +#%RAML 1.0 +version: api +title: BuyosExperienceLayer +baseUri: http://localhost:24045/api + +uses: + candaCommons: canda-commons/1.0.8/canda-commons.raml + +securedBy: [candaCommons.basicAuth] + +# Workaround as https://github.com/mulesoft-labs/raml-java-client-generator +# does not detect securitySchemes placed in the "uses" section. +#securitySchemes: +# clientid: +# description: Client ID Policy +# type: Basic Authentication + +#securedBy: [clientid] + +/users/{id}: + get: + responses: + 200: + body: + application/json: + example: | + { "userId": "foo" } + diff --git a/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/canda-commons/1.0.8/canda-commons.raml b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/canda-commons/1.0.8/canda-commons.raml new file mode 100644 index 0000000..5ec3962 --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/canda-commons/1.0.8/canda-commons.raml @@ -0,0 +1,15 @@ +#%RAML 1.0 Library + +securitySchemes: + basicAuth: + displayName: Basic Authentication + description: This API supports Basic Authentication. The client has to provide an "Authorization" header with valid credentials. + type: Basic Authentication + describedBy: + headers: + Authorization: + description: Used to send valid credentials. + type: string + responses: + 401: + description: Credentials are missing or could not be validated by the server. diff --git a/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/api/BuyosExperienceLayerClient.java b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/api/BuyosExperienceLayerClient.java new file mode 100644 index 0000000..d20ba20 --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/api/BuyosExperienceLayerClient.java @@ -0,0 +1,44 @@ + +package securedby_with_uses.api; + +import javax.ws.rs.client.ClientBuilder; +import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; +import securedby_with_uses.resource.users.Users; + +public class BuyosExperienceLayerClient { + + private static java.lang.String username; + private static java.lang.String password; + private java.lang.String _baseUrl; + public final Users users; + + public BuyosExperienceLayerClient(java.lang.String baseUrl, java.lang.String username, java.lang.String password) { + this.username = username; + this.password = password; + _baseUrl = baseUrl; + users = new Users(getBaseUri(), getClient()); + } + + public BuyosExperienceLayerClient(java.lang.String username, java.lang.String password) { + this("http://localhost:24045/api", username, password); + } + + protected javax.ws.rs.client.Client getClient() { + final javax.ws.rs.client.Client _client = ClientBuilder.newClient(); + _client.register(HttpAuthenticationFeature.basic(username, password)); + return _client; + } + + protected java.lang.String getBaseUri() { + return _baseUrl; + } + + public static BuyosExperienceLayerClient create(java.lang.String baseUrl, java.lang.String username, java.lang.String password) { + return new BuyosExperienceLayerClient(baseUrl, username, password); + } + + public static BuyosExperienceLayerClient create(java.lang.String username, java.lang.String password) { + return new BuyosExperienceLayerClient(username, password); + } + +} diff --git a/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/exceptions/BuyosExperienceLayerException.java b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/exceptions/BuyosExperienceLayerException.java new file mode 100644 index 0000000..59a3aaa --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/exceptions/BuyosExperienceLayerException.java @@ -0,0 +1,44 @@ + +package securedby_with_uses.exceptions; + +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; + +public class BuyosExperienceLayerException + extends RuntimeException +{ + + private int statusCode; + private String reason; + private MultivaluedMap headers; + private Response response; + + public BuyosExperienceLayerException(int statusCode, String reason, MultivaluedMap headers, Response response) { + super(reason); + this.statusCode = statusCode; + this.reason = reason; + this.headers = headers; + this.response = response; + } + + public BuyosExperienceLayerException(int statusCode, String reason) { + this(statusCode, reason, null, null); + } + + public int getStatusCode() { + return this.statusCode; + } + + public String getReason() { + return this.reason; + } + + public MultivaluedMap getHeaders() { + return this.headers; + } + + public Response getResponse() { + return this.response; + } + +} diff --git a/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/resource/users/Users.java b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/resource/users/Users.java new file mode 100644 index 0000000..91dcc6e --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/resource/users/Users.java @@ -0,0 +1,34 @@ + +package securedby_with_uses.resource.users; + +import javax.ws.rs.client.Client; +import securedby_with_uses.resource.users.id.Id; + +public class Users { + + private String _baseUrl; + private Client _client; + + public Users() { + _baseUrl = null; + _client = null; + } + + public Users(String baseUrl, Client _client) { + _baseUrl = (baseUrl +"/users"); + this._client = _client; + } + + protected Client getClient() { + return this._client; + } + + private String getBaseUri() { + return _baseUrl; + } + + public Id id(String id) { + return new Id(getBaseUri(), getClient(), id); + } + +} diff --git a/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/resource/users/id/Id.java b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/resource/users/id/Id.java new file mode 100644 index 0000000..b01d688 --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/resource/users/id/Id.java @@ -0,0 +1,48 @@ + +package securedby_with_uses.resource.users.id; + +import java.net.URLEncoder; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status.Family; +import securedby_with_uses.exceptions.BuyosExperienceLayerException; +import securedby_with_uses.responses.BuyosExperienceLayerResponse; + +public class Id { + + private String _baseUrl; + private Client _client; + + public Id() { + _baseUrl = null; + _client = null; + } + + public Id(String baseUrl, Client _client, String uriParam) { + _baseUrl = (baseUrl +("/"+ URLEncoder.encode(uriParam))); + this._client = _client; + } + + protected Client getClient() { + return this._client; + } + + private String getBaseUri() { + return _baseUrl; + } + + public BuyosExperienceLayerResponse get() { + WebTarget target = this._client.target(getBaseUri()); + final javax.ws.rs.client.Invocation.Builder invocationBuilder = target.request(MediaType.APPLICATION_JSON_TYPE); + Response response = invocationBuilder.get(); + if (response.getStatusInfo().getFamily()!= Family.SUCCESSFUL) { + Response.StatusType statusInfo = response.getStatusInfo(); + throw new BuyosExperienceLayerException(statusInfo.getStatusCode(), statusInfo.getReasonPhrase(), response.getStringHeaders(), response); + } + BuyosExperienceLayerResponse apiResponse = new BuyosExperienceLayerResponse(response.readEntity(securedby_with_uses.resource.users.id.model.IdGETResponseBody.class), response.getStringHeaders(), response); + return apiResponse; + } + +} diff --git a/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/resource/users/id/model/IdGETResponseBody.java b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/resource/users/id/model/IdGETResponseBody.java new file mode 100644 index 0000000..03eedd6 --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/resource/users/id/model/IdGETResponseBody.java @@ -0,0 +1,110 @@ + +package securedby_with_uses.resource.users.id.model; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "userId" +}) +public class IdGETResponseBody { + + @JsonProperty("userId") + private String userId; + @JsonIgnore + private Map additionalProperties = new HashMap(); + + /** + * No args constructor for use in serialization + * + */ + public IdGETResponseBody() { + } + + /** + * + * @param userId + */ + public IdGETResponseBody(String userId) { + super(); + this.userId = userId; + } + + @JsonProperty("userId") + public String getUserId() { + return userId; + } + + @JsonProperty("userId") + public void setUserId(String userId) { + this.userId = userId; + } + + public IdGETResponseBody withUserId(String userId) { + this.userId = userId; + return this; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + public IdGETResponseBody withAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(IdGETResponseBody.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); + sb.append("userId"); + sb.append('='); + sb.append(((this.userId == null)?"":this.userId)); + sb.append(','); + sb.append("additionalProperties"); + sb.append('='); + sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); + sb.append(','); + if (sb.charAt((sb.length()- 1)) == ',') { + sb.setCharAt((sb.length()- 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.userId == null)? 0 :this.userId.hashCode())); + result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof IdGETResponseBody) == false) { + return false; + } + IdGETResponseBody rhs = ((IdGETResponseBody) other); + return (((this.userId == rhs.userId)||((this.userId!= null)&&this.userId.equals(rhs.userId)))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties)))); + } + +} diff --git a/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/responses/BuyosExperienceLayerResponse.java b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/responses/BuyosExperienceLayerResponse.java new file mode 100644 index 0000000..d4bbf43 --- /dev/null +++ b/raml-client-generator-core/src/test/resources/v2/securedby_with_uses/output/securedby_with_uses/responses/BuyosExperienceLayerResponse.java @@ -0,0 +1,31 @@ + +package securedby_with_uses.responses; + +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; + +public class BuyosExperienceLayerResponse{ + + private T body; + private MultivaluedMap headers; + private Response response; + + public BuyosExperienceLayerResponse(T body, MultivaluedMap headers, Response response) { + this.body = body; + this.headers = headers; + this.response = response; + } + + public T getBody() { + return this.body; + } + + public MultivaluedMap getHeaders() { + return this.headers; + } + + public Response getResponse() { + return this.response; + } + +}