Perfect. This is just the info I needed.
On Tuesday, April 14, 2015 at 10:22:05 AM UTC-5, Mac Collins wrote:
> Hi Matt,
>
> That's the idea. We use this same format in the ThreadFix UI so that we
> can use generic Angular controllers for most of the modals and still have
> easily customizable error messages. Any Angular code that interacts with
> the ThreadFix UI will have some code like this:
>
> if (data.success) {
> // close the modal, display success message, etc.
> } else {
> $scope.errorMessage = "Failure: " + data.message;
> }
>
>
> Other API clients can use similar logic. We standardized our JSON format
> by returning a RestResponse object with a type parameter from most
> @Controller methods, which then gets fed to Spring serialization. Our
> threadfix-cli package deserializes the JSON back into the original
> RestResponse<?> format, so instead of working with a generic JSON object
> you can work with a RestResponse<Application>, RestResponse<Scan>, etc.
> and take advantage of static typing.
>
> While I'm on the subject, the threadfix-cli package is now available in
> the Maven Central repositories:
>
http://mvnrepository.com/artifact/com.denimgroup.threadfix/threadfix-cli
>
>
> Thanks,
> Mac
>