From d5ddac8e7ec25598b671e18383fe896b03a508c4 Mon Sep 17 00:00:00 2001 From: Rob Blair Date: Mon, 16 Jun 2014 12:51:35 -0700 Subject: [PATCH] Update java mustache to show error status codes and models in generated API, in comments. * I wonder if there is some clever way to make exceptions based on the model thrown, and automatically fill them in with the parsed error models? * Until then, it's comments, and roll your own. --- src/main/resources/Java/api.mustache | 4 ++++ src/main/resources/android-java/api.mustache | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/main/resources/Java/api.mustache b/src/main/resources/Java/api.mustache index d94d0b2a4e..65c0324fea 100644 --- a/src/main/resources/Java/api.mustache +++ b/src/main/resources/Java/api.mustache @@ -27,6 +27,10 @@ public class {{classname}} { } {{#operation}} + {{#errorList}} //error info- code: {{code}} reason: "{{reason}}" model: {{#responseModel}}{{responseModel}} + {{/responseModel}}{{^responseModel}} + {{/responseModel}} + {{/errorList}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { {{#requiredParamCount}} // verify required params are set diff --git a/src/main/resources/android-java/api.mustache b/src/main/resources/android-java/api.mustache index 7426e724da..90eac11961 100644 --- a/src/main/resources/android-java/api.mustache +++ b/src/main/resources/android-java/api.mustache @@ -30,6 +30,10 @@ public class {{classname}} { } {{#operation}} + {{#errorList}} //error info- code: {{code}} reason: "{{reason}}" model: {{#responseModel}}{{responseModel}} + {{/responseModel}}{{^responseModel}} + {{/responseModel}} + {{/errorList}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { {{#requiredParamCount}} // verify required params are set