Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,13 @@ public void localeDownloadTest() throws ApiException, IOException, InterruptedEx
Object customMetadataFilters = null;
String translationKeyPrefix = null;
Boolean filterByPrefix = null;
List<String> localeIds = null;
File response = api.localeDownload(projectId, id, xPhraseAppOTP, ifModifiedSince, ifNoneMatch,
branch, fileFormat, tags, tag, includeEmptyTranslations, excludeEmptyZeroForms,
includeTranslatedKeys, keepNotranslateTags, convertEmoji, formatOptions, encoding,
skipUnverifiedTranslations, includeUnverifiedTranslations, useLastReviewedVersion,
fallbackLocaleId, sourceLocaleId, translationKeyPrefix, filterByPrefix,
customMetadataFilters);
customMetadataFilters, localeIds);

String fileContents = new String(java.nio.file.Files.readAllBytes(response.toPath()));
Assert.assertEquals("Correct file contents", fileContents, body);
Expand Down
15 changes: 15 additions & 0 deletions doc/compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -8582,6 +8582,21 @@
},
"style": "deepObject",
"explode": true
},
{
"name": "locale_ids",
"description": "Locale IDs or locale names",
"in": "query",
"schema": {
"type": "array",
"items": {
"type": "string"
}
},
"example": [
"de",
"en"
]
}
],
"responses": {
Expand Down
11 changes: 8 additions & 3 deletions openapi-generator/templates/cli/api.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,16 @@ func init{{{nickname}}}() {
{{/isModel~}}
{{^isPrimitiveType}}{{^isModel}}
if params.IsSet(helpers.ToSnakeCase("{{paramName}}")) {
var {{paramName}} map[string]interface{}
if err := json.Unmarshal([]byte(params.GetString(helpers.ToSnakeCase("{{{vendorExtensions.x-export-param-name}}}"))), &{{paramName}}); err != nil {
{{#if (eq dataType "[]string")}}
var {{paramName}} []string
{{else}}
var {{paramName}} map[string]interface{}
{{/if}}

if err := json.Unmarshal([]byte(params.GetString(helpers.ToSnakeCase("{{{paramName}}}"))), &{{paramName}}); err != nil {
HandleError(err)
}
localVarOptionals.{{{vendorExtensions.x-export-param-name}}} = optional.NewInterface({{paramName}})
localVarOptionals.{{{vendorExtensions.x-export-param-name}}} = {{#if (eq dataType "[]string")}}{{paramName}}{{else}}optional.NewInterface({{paramName}}){{/if}}
}
{{/isModel}}{{/isPrimitiveType}}
{{/if}}
Expand Down
17 changes: 15 additions & 2 deletions openapi-generator/templates/go/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ type {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts struct {
{{/isBinary}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{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}}`
{{#isArray}}
{{vendorExtensions.x-export-param-name}} []string `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
{{/isArray}}
{{^isArray}}
{{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}}`
{{/isArray}}
{{/isPrimitiveType}}
{{/required}}
{{/allParams}}
Expand Down Expand Up @@ -154,8 +159,15 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams
{{/isCollectionFormatMulti}}
{{/required}}
{{^required}}
if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() {
if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}{{^isArray}}.IsSet(){{/isArray}}{{#isArray}} != nil{{/isArray}} {
{{#isCollectionFormatMulti}}
{{#isArray}}
t := localVarOptionals.{{vendorExtensions.x-export-param-name}}
for i := range t {
localVarQueryParams.Add("{{baseName}}[]", parameterToString(t[i], "multi"))
}
{{/isArray}}
{{^isArray}}
t:=localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value()
if reflect.TypeOf(t).Kind() == reflect.Slice {
s := reflect.ValueOf(t)
Expand All @@ -165,6 +177,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams
} else {
localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
}
{{/isArray}}
{{/isCollectionFormatMulti}}
{{^isCollectionFormatMulti}}
{{#isPrimitiveType}}localVarQueryParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")){{/isPrimitiveType}}{{^isPrimitiveType}}for key, value := range localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value().(map[string]interface{}) {
Expand Down
10 changes: 10 additions & 0 deletions paths/locales/download.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ parameters:
properties: {}
style: deepObject
explode: true
- name: locale_ids
description: Locale IDs or locale names
in: query
schema:
type: array
items:
type: string
example:
- de
- en
responses:
"200":
description: OK
Expand Down
Loading