Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
12249d8
feat: Update openapi-generator to v7
jablan Oct 5, 2023
51a80c6
fix external template reference
jablan Oct 6, 2023
d77a1a3
Fix gitignore
jablan Oct 6, 2023
3c06a91
get generated go files closer to legacy
jablan Oct 6, 2023
f446135
adapt python templates
jablan Oct 6, 2023
5841b47
adapt php templates
jablan Oct 6, 2023
cdce53f
adapt java templates
jablan Oct 6, 2023
4879b2b
adjust go Api suffix
jablan Oct 6, 2023
5943520
adapt TS templates
jablan Oct 6, 2023
23b652b
adapt CLI, more fixes
jablan Oct 6, 2023
73571b9
update java pojo.mustache template
jablan Oct 9, 2023
45caf3d
ignore cli binary
jablan Oct 9, 2023
e835843
Merge branch 'master' into tsi-1874-update-generator-v7
jablan Oct 10, 2023
61daf2b
Merge branch 'master' into tsi-1874-update-generator-v7
jablan Oct 11, 2023
0124884
deserialize Time
jablan Oct 11, 2023
3fd81cf
keeping DateTime for timestamps
jablan Oct 11, 2023
b4f1b2e
Merge branch 'master' into tsi-1874-update-generator-v7
jablan Oct 12, 2023
630860f
Merge branch 'master' into tsi-1874-update-generator-v7
jablan Oct 13, 2023
b48ecbf
primitives have been changed
jablan Oct 13, 2023
726d7e2
Merge branch 'master' into tsi-1874-update-generator-v7
jablan Oct 13, 2023
7f6fd67
list[] is now List[] in python generator
jablan Oct 13, 2023
19ac732
Merge branch 'master' into tsi-1874-update-generator-v7
jablan Oct 30, 2023
1674d4e
python: file -> bytearray
jablan Oct 30, 2023
1224b6f
go: add blank test template
jablan Oct 30, 2023
0a1d7c1
go: prevent generating tests
jablan Oct 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ docs: lint bundle
ruby:
openapi-generator-cli generate -i tmp/compiled.yaml -g ruby -o clients/ruby -c ./openapi-generator/ruby_lang.yaml
go:
openapi-generator-cli generate -i tmp/compiled.yaml -g go -o clients/go -c ./openapi-generator/go_lang.yaml
openapi-generator-cli generate -i tmp/compiled.yaml -g go -o clients/go -c ./openapi-generator/go_lang.yaml --global-property apiTests=false,modelTests=false
go install golang.org/x/tools/cmd/goimports@latest
goimports -w clients/go
cd clients/go && go mod tidy
Expand Down
2 changes: 1 addition & 1 deletion doc/compiled.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ openapi: 3.0.3
info:
title: Phrase Strings API Reference
version: 2.0.0
description:
$ref: "./intro.md"
description: |
Phrase Strings is a translation management platform for software projects. You can collaborate on language file translation
with your team or order translations through our platform. The API allows you to import locale files, download locale files,
tag keys or interact in other ways with the localization data stored in Phrase Strings for your account.

contact:
name: Phrase Support
Expand Down
1 change: 1 addition & 0 deletions openapi-generator/cli_lang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ outputDir: clients/cli
packageName: phrase
packageVersion: 2.14.0
templateDir: openapi-generator/templates/cli
apiNameSuffix: Api
1 change: 1 addition & 0 deletions openapi-generator/go_lang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ gitUserId: phrase
gitRepoId: phrase-go
httpUserAgent: Phrase Strings go
templateDir: openapi-generator/templates/go
apiNameSuffix: Api
4 changes: 2 additions & 2 deletions openapi-generator/templates/cli/api.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func init{{{nickname}}}() {
{{else~}}
{{#isPrimitiveType~}}
if params.IsSet(helpers.ToSnakeCase("{{paramName}}")) {
localVarOptionals.{{{vendorExtensions.x-export-param-name}}} = optional.New{{{vendorExtensions.x-optional-data-type}}}(params.Get{{{vendorExtensions.x-optional-data-type}}}(helpers.ToSnakeCase("{{{vendorExtensions.x-export-param-name}}}")))
localVarOptionals.{{{vendorExtensions.x-export-param-name}}} = optional.New{{capitalizeFirst dataType}}(params.Get{{{capitalizeFirst dataType}}}(helpers.ToSnakeCase("{{{vendorExtensions.x-export-param-name}}}")))
}
{{/isPrimitiveType~}}
{{#isModel~}}
Expand All @@ -111,7 +111,7 @@ func init{{{nickname}}}() {
{{/required~}}
{{/allParams~}}

data, api_response, err := client.{{classname}}.{{{nickname}}}(auth{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}&localVarOptionals{{/hasOptionalParams}})
data, api_response, err := client.{{classname}}.{{{nickname}}}(auth{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}}{{#unless @last}}, {{/unless}}{{/required}}{{/allParams}}{{#hasOptionalParams}}&localVarOptionals{{/hasOptionalParams}})

if err != nil {
switch castedError := err.(type) {
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
21 changes: 18 additions & 3 deletions openapi-generator/templates/go/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,22 @@ func main() {
}
```

{{>../shared/datacenters}}
## Datacenters

The API is only accessible via HTTPS and the current version is <code>v2</code>, which results in a base URL like: <code>{{{basePath}}}</code> depending on the datacenter.

### EU Datacenter
```
{{{basePath}}}
```

This is the default datacenter.

### US Datacenter
```
https://api.us.app.phrase.com/v2/
```

### Specifying US Datacenter
You can use the US datacenter by setting the following:
```
Expand Down Expand Up @@ -77,8 +92,8 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})

## Author

{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
{{/hasMore}}{{/apis}}{{/apiInfo}}
{{#apiInfo}}{{#apis}}{{^-last}}{{infoEmail}}
{{/-last}}{{/apis}}{{/apiInfo}}

## Get help / support

Expand Down
11 changes: 6 additions & 5 deletions openapi-generator/templates/go/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
_neturl "net/url"
{{#imports}} "{{import}}"
{{/imports}}
"github.com/antihax/optional"
)

// Linger please
Expand All @@ -28,7 +29,7 @@ type {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts struct {
{{^required}}
{{#isPrimitiveType}}
{{^isBinary}}
{{vendorExtensions.x-export-param-name}} optional.{{vendorExtensions.x-optional-data-type}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
{{vendorExtensions.x-export-param-name}} optional.{{#lambda.titlecase}}{{dataType}}{{/lambda.titlecase}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
{{/isBinary}}
{{#isBinary}}
{{vendorExtensions.x-export-param-name}} optional.Interface `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
Expand Down Expand Up @@ -57,15 +58,15 @@ type {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts struct {
* @param optional nil or *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts - Optional Parameters:
{{#allParams}}
{{^required}}
* @param "{{vendorExtensions.x-export-param-name}}" ({{#isPrimitiveType}}{{^isBinary}}optional.{{vendorExtensions.x-optional-data-type}}{{/isBinary}}{{#isBinary}}optional.Interface of {{dataType}}{{/isBinary}}{{/isPrimitiveType}}{{^isPrimitiveType}}optional.Interface of {{dataType}}{{/isPrimitiveType}}) - {{#description}} {{{.}}}{{/description}}
* @param "{{vendorExtensions.x-export-param-name}}" ({{#isPrimitiveType}}{{^isBinary}}optional.{{#lambda.titlecase}}{{dataType}}{{/lambda.titlecase}}{{/isBinary}}{{#isBinary}}optional.Interface of {{dataType}}{{/isBinary}}{{/isPrimitiveType}}{{^isPrimitiveType}}optional.Interface of {{dataType}}{{/isPrimitiveType}}) - {{#description}} {{{.}}}{{/description}}
{{/required}}
{{/allParams}}
{{/hasOptionalParams}}
{{#returnType}}
@return {{{returnType}}}
{{/returnType}}
*/
func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}{{^returnType}}[]byte, {{/returnType}}*APIResponse, error) {
func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}{{^returnType}}[]byte, {{/returnType}}*APIResponse, error) {
var (
localVarHTTPMethod = _nethttp.Method{{httpMethod}}
localVarPostBody interface{}
Expand Down Expand Up @@ -337,9 +338,9 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams
return {{#returnType}}localVarReturnValue, {{/returnType}}{{^returnType}}nil, {{/returnType}}localVarHTTPResponse, newErr
}
newErr.model = v
{{#hasMore}}
{{^-last}}
return {{#returnType}}localVarReturnValue, {{/returnType}}{{^returnType}}nil, {{/returnType}}localVarHTTPResponse, newErr
{{/hasMore}}
{{/-last}}
{{^wildcard}}
}
{{/wildcard}}
Expand Down
8 changes: 4 additions & 4 deletions openapi-generator/templates/go/api_doc.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Method | HTTP request | Description

## {{{operationId}}}

> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}(ctx, {{#allParams}}{{#required}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}optional{{/hasOptionalParams}})
> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}(ctx, {{#allParams}}{{#required}}{{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}optional{{/hasOptionalParams}})

{{{summary}}}{{#notes}}

Expand All @@ -36,7 +36,7 @@ Optional parameters are passed through a pointer to a {{{nickname}}}Opts struct

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}{{#allParams}}
{{^required}} **{{paramName}}** | {{#isFile}}**optional.Interface of {{dataType}}**{{/isFile}}{{#isPrimitiveType}}**optional.{{vendorExtensions.x-optional-data-type}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**optional.Interface of {{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/required}}{{/allParams}}{{/hasOptionalParams}}
{{^required}} **{{paramName}}** | {{#isFile}}**optional.Interface of {{dataType}}**{{/isFile}}{{#isPrimitiveType}}**optional.{{#lambda.titlecase}}{{dataType}}{{/lambda.titlecase}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**optional.Interface of {{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/required}}{{/allParams}}{{/hasOptionalParams}}

### Return type

Expand All @@ -48,8 +48,8 @@ Name | Type | Description | Notes

### HTTP request headers

- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
Expand Down
6 changes: 3 additions & 3 deletions openapi-generator/templates/java/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class {{{classname}}}Example {
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
{{/allParams}}
try {
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}}
System.out.println(result);{{/returnType}}
} catch (ApiException e) {
System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
Expand Down Expand Up @@ -167,8 +167,8 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea

## Author

{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
{{/hasMore}}{{/apis}}{{/apiInfo}}
{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
{{/-last}}{{/apis}}{{/apiInfo}}

## Get help / support

Expand Down
8 changes: 4 additions & 4 deletions openapi-generator/templates/java/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class {{classname}} {
{{#isDeprecated}}
@Deprecated
{{/isDeprecated}}
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
{{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set
Expand Down Expand Up @@ -99,16 +99,16 @@ public class {{classname}} {
{{/formParams}}

final String[] localVarAccepts = {
{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

final String[] localVarContentTypes = {
{{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} };

{{#returnType}}
GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {};
Expand Down
8 changes: 4 additions & 4 deletions openapi-generator/templates/java/api_doc.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Method | HTTP request | Description

## {{operationId}}

> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})

{{summary}}{{#notes}}

Expand Down Expand Up @@ -61,7 +61,7 @@ public class Example {
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
{{/allParams}}
try {
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}}
System.out.println(result);{{/returnType}}
} catch (ApiException e) {
System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
Expand Down Expand Up @@ -92,8 +92,8 @@ Name | Type | Description | Notes

### HTTP request headers

- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}

{{#responses.0}}
### HTTP response details
Expand Down
2 changes: 1 addition & 1 deletion openapi-generator/templates/java/api_test.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class {{classname}}Test {
//{{#allParams}}
//{{{dataType}}} {{paramName}} = null;
//{{/allParams}}
//{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
//{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});

// TODO: test validations
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Else use custom behaviour, IOW use whatever is defined on the object mapper
}}
@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
@JsonInclude({{#isMapContainer}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMapContainer}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}})
@JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}})
{{#withXml}}
{{^isContainer}}
@JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class ApiClient {
auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}");
{{/isApiKey}}
{{#isOAuth}}
auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}");
auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}");
{{/isOAuth}}
} else {{/authMethods}}{
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
Expand Down
14 changes: 7 additions & 7 deletions openapi-generator/templates/java/libraries/feign/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ public interface {{classname}} extends ApiClient.Api {
* @see <a href="{{url}}">{{summary}} Documentation</a>
{{/externalDocs}}
*/
@RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}")
@RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}")
@Headers({
{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}",
{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}}
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{#hasMore}},
{{/hasMore}}{{/headerParams}}
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}},
{{/-last}}{{/headerParams}}
})
{{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{baseName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
{{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{baseName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
{{#hasQueryParams}}

/**
Expand Down Expand Up @@ -73,12 +73,12 @@ public interface {{classname}} extends ApiClient.Api {
* @see <a href="{{url}}">{{summary}} Documentation</a>
{{/externalDocs}}
*/
@RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}")
@RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}")
@Headers({
{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}",
{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}}
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{#hasMore}},
{{/hasMore}}{{/headerParams}}
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}},
{{/-last}}{{/headerParams}}
})
{{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{baseName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map<String, Object> queryParams);

Expand Down
Loading