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.
This commit is contained in:
Rob Blair
2014-06-16 12:51:35 -07:00
parent e8210cd5e3
commit d5ddac8e7e
2 changed files with 8 additions and 0 deletions

View File

@@ -27,6 +27,10 @@ public class {{classname}} {
}
{{#operation}}
{{#errorList}} //error info- code: {{code}} reason: "{{reason}}" model: {{#responseModel}}{{responseModel}}
{{/responseModel}}{{^responseModel}}<none>
{{/responseModel}}
{{/errorList}}
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
{{#requiredParamCount}}
// verify required params are set

View File

@@ -30,6 +30,10 @@ public class {{classname}} {
}
{{#operation}}
{{#errorList}} //error info- code: {{code}} reason: "{{reason}}" model: {{#responseModel}}{{responseModel}}
{{/responseModel}}{{^responseModel}}<none>
{{/responseModel}}
{{/errorList}}
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
{{#requiredParamCount}}
// verify required params are set