forked from loafle/openapi-generator-original
* [html2] Clean up namespace issues in code samples * pull c# and php package namespace from --additional-properties arg phpInvokerPackage arg now sets the PHP namespace and packageName sets the CSharp namespace. invokerPackage still works for Java and Android namespace.
18 lines
766 B
Plaintext
18 lines
766 B
Plaintext
import {{{invokerPackage}}}.api.{{{classname}}};
|
|
|
|
public class {{{classname}}}Example {
|
|
|
|
public static void main(String[] args) {
|
|
{{{classname}}} apiInstance = new {{{classname}}}();
|
|
{{#allParams}}
|
|
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
|
{{/allParams}}
|
|
try {
|
|
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
|
System.out.println(result);{{/returnType}}
|
|
} catch (ApiException e) {
|
|
System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
} |