diff --git a/src/main/java/org/reso/service/data/definition/LookupDefinition.java b/src/main/java/org/reso/service/data/definition/LookupDefinition.java index f3817d3..29c4d7c 100644 --- a/src/main/java/org/reso/service/data/definition/LookupDefinition.java +++ b/src/main/java/org/reso/service/data/definition/LookupDefinition.java @@ -14,7 +14,7 @@ public class LookupDefinition extends ResourceInfo public LookupDefinition() { this.tableName = "lookup"; - this.resourcesName = "Lookups"; + this.resourcesName = "Lookup"; this.resourceName = "Lookup"; } diff --git a/src/main/java/org/reso/service/servlet/TokenServlet.java b/src/main/java/org/reso/service/servlet/TokenServlet.java index 51f754b..fc5e16f 100644 --- a/src/main/java/org/reso/service/servlet/TokenServlet.java +++ b/src/main/java/org/reso/service/servlet/TokenServlet.java @@ -1,6 +1,7 @@ package org.reso.service.servlet; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.PropertyNamingStrategy; import org.reso.service.security.providers.BearerAuthProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/reso/service/servlet/util/SimpleError.java b/src/main/java/org/reso/service/servlet/util/SimpleError.java index a7c5063..ddcece1 100644 --- a/src/main/java/org/reso/service/servlet/util/SimpleError.java +++ b/src/main/java/org/reso/service/servlet/util/SimpleError.java @@ -3,7 +3,9 @@ package org.reso.service.servlet.util; public class SimpleError { - String error; + private String error; + + // Constants for standard errors. static public String AUTH_REQUIRED = "auth_required"; static public String INVALID_REQUEST = "invalid_request"; @@ -13,7 +15,7 @@ public class SimpleError this.error = error; } - + // Accessor, used by ObjectMapper to serialize the error. public String getError() { return error; diff --git a/src/main/java/org/reso/service/servlet/util/Token.java b/src/main/java/org/reso/service/servlet/util/Token.java index 2e62a53..db844c7 100644 --- a/src/main/java/org/reso/service/servlet/util/Token.java +++ b/src/main/java/org/reso/service/servlet/util/Token.java @@ -1,12 +1,16 @@ package org.reso.service.servlet.util; +import com.fasterxml.jackson.annotation.JsonProperty; public class Token { - String accessToken; - String tokenType; - String scope; + // One must conform to the snake case naming convention for JSON representation of these properties + @JsonProperty("access_token") + private String accessToken; + @JsonProperty("token_type") + private String tokenType; + private String scope; public Token(String authBearerToken, String tokenType, String scope) @@ -50,6 +54,8 @@ public class Token } + // Accessors, used by ObjectMapper to serialize the token. + public String getAccessToken() { return accessToken;