Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !1739

Fix missing closing parenthesis

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/ackintosh/fix-header-params into master 6 years ago
  • Overview 0
  • Commits 5
  • Pipelines 0
  • Changes 113

Created by: ackintosh

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

The closing parenthesis of localVariableHeaders declaration is missed when the spec has parameter in: header.

$ bin/openapi3/kotlin-client-petstore.sh
$ cd samples/openapi3/client/petstore/kotlin
$ gradle wrapper
$ ./gradlew check assemble

:compileKotlin
Using kotlin incremental compilation
e: /Users/akihito1/src/github.com/ackintosh/openapi-generator-1/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt: (307, 9): Expecting ')'
Compare
  • master (base)

and
  • latest version
    071e3aab
    5 commits, 2 years ago

113 files
+ 5599
- 1

    Preferences

    File browser
    Compare changes
bin/op‎enapi3‎
kotlin-clien‎t-petstore.sh‎ +35 -0
modules/…/…/…/‎…/kotlin-client‎
api.mu‎stache‎ +1 -1
samples/openapi3/cl‎ient/petstore/kotlin‎
.openapi-‎generator‎
VER‎SION‎ +1 -0
do‎cs‎
200_res‎ponse.md‎ +11 -0
AdditionalProp‎ertiesClass.md‎ +11 -0
Anim‎al.md‎ +11 -0
AnotherF‎akeApi.md‎ +56 -0
ApiResp‎onse.md‎ +12 -0
ArrayOfArrayO‎fNumberOnly.md‎ +10 -0
ArrayOfNum‎berOnly.md‎ +10 -0
ArrayT‎est.md‎ +12 -0
Capitali‎zation.md‎ +15 -0
Cat‎.md‎ +10 -0
Categ‎ory.md‎ +11 -0
ClassM‎odel.md‎ +10 -0
Clie‎nt.md‎ +10 -0
Defaul‎tApi.md‎ +50 -0
Dog‎.md‎ +10 -0
EnumAr‎rays.md‎ +25 -0
EnumCl‎ass.md‎ +14 -0
Enum_T‎est.md‎ +42 -0
FakeA‎pi.md‎ +625 -0
FakeClassname‎Tags123Api.md‎ +56 -0
FileSchemaT‎estClass.md‎ +11 -0
Foo‎.md‎ +10 -0
Format_‎test.md‎ +24 -0
HasOnlyRe‎adOnly.md‎ +11 -0
Inline_o‎bject.md‎ +11 -0
Inline_ob‎ject_1.md‎ +11 -0
Inline_ob‎ject_2.md‎ +25 -0
Inline_ob‎ject_3.md‎ +23 -0
Inline_ob‎ject_4.md‎ +11 -0
Inline_ob‎ject_5.md‎ +11 -0
Inline_respon‎se_default.md‎ +10 -0
Lis‎t.md‎ +10 -0
MapTe‎st.md‎ +20 -0
MixedPropertiesAndAddit‎ionalPropertiesClass.md‎ +12 -0
Nam‎e.md‎ +13 -0
Number‎Only.md‎ +10 -0
Orde‎r.md‎ +22 -0
OuterCom‎posite.md‎ +12 -0
OuterE‎num.md‎ +14 -0
Pet‎.md‎ +22 -0
PetA‎pi.md‎ +438 -0
ReadOnly‎First.md‎ +11 -0
Retu‎rn.md‎ +10 -0
Store‎Api.md‎ +193 -0
Tag‎.md‎ +11 -0
Use‎r.md‎ +17 -0
UserA‎pi.md‎ +376 -0
_special_mo‎del.name_.md‎ +10 -0
src/main/kotlin/org‎/openapitools/client‎
ap‎is‎
AnotherF‎akeApi.kt‎ +52 -0
Defaul‎tApi.kt‎ +51 -0
FakeA‎pi.kt‎ +427 -0
FakeClassname‎Tags123Api.kt‎ +52 -0
PetA‎pi.kt‎ +312 -0
Store‎Api.kt‎ +146 -0
UserA‎pi.kt‎ +271 -0
infrast‎ructure‎
ApiAbstra‎ctions.kt‎ +20 -0
ApiCli‎ent.kt‎ +130 -0
ApiInfrastruct‎ureResponse.kt‎ +40 -0
Application‎Delegates.kt‎ +29 -0
Erro‎rs.kt‎ +42 -0
RequestC‎onfig.kt‎ +16 -0
RequestM‎ethod.kt‎ +8 -0
ResponseEx‎tensions.kt‎ +23 -0
Serial‎izer.kt‎ +14 -0
mod‎els‎
AdditionalProp‎ertiesClass.kt‎ +26 -0
Anim‎al.kt‎ +26 -0
ApiResp‎onse.kt‎ +28 -0
ArrayOfArrayO‎fNumberOnly.kt‎ +24 -0
ArrayOfNum‎berOnly.kt‎ +24 -0
ArrayT‎est.kt‎ +29 -0
Capitali‎zation.kt‎ +35 -0
Cat‎.kt‎ +27 -0
Categ‎ory.kt‎ +26 -0
ClassM‎odel.kt‎ +24 -0
Clie‎nt.kt‎ +24 -0
Dog‎.kt‎ +27 -0
EnumAr‎rays.kt‎ +51 -0
EnumCl‎ass.kt‎ +30 -0
EnumT‎est.kt‎ +86 -0
FileSchemaT‎estClass.kt‎ +26 -0
Foo‎.kt‎ +24 -0
Format‎Test.kt‎ +54 -0
HasOnlyRe‎adOnly.kt‎ +26 -0
InlineO‎bject.kt‎ +28 -0
InlineOb‎ject1.kt‎ +28 -0
InlineOb‎ject2.kt‎ +55 -0
InlineOb‎ject3.kt‎ +64 -0
InlineOb‎ject4.kt‎ +28 -0
InlineOb‎ject5.kt‎ +28 -0
InlineRespon‎seDefault.kt‎ +25 -0
Lis‎t.kt‎ +24 -0
MapTe‎st.kt‎ +43 -0
MixedPropertiesAndAddit‎ionalPropertiesClass.kt‎ +29 -0
Model200R‎esponse.kt‎ +26 -0
Nam‎e.kt‎ +30 -0
Number‎Only.kt‎ +24 -0
Orde‎r.kt‎ +50 -0
OuterCom‎posite.kt‎ +28 -0
OuterE‎num.kt‎ +30 -0
Pet‎.kt‎ +52 -0
ReadOnly‎First.kt‎ +26 -0
Retu‎rn.kt‎ +24 -0
SpecialMo‎delname.kt‎ +24 -0
Tag‎.kt‎ +26 -0
Use‎r.kt‎ +39 -0
.openapi-gen‎erator-ignore‎ +23 -0
READ‎ME.md‎ +153 -0
build.‎gradle‎ +33 -0
setting‎s.gradle‎ +1 -0
.giti‎gnore‎ +1 -0
bin/openapi3/kotlin-client-petstore.sh 0 → 100755
+ 35
- 0
  • View file @ 071e3aab

  • Edit in single-file editor

  • Open in Web IDE

 
#!/bin/sh
 
 
SCRIPT="$0"
 
echo "# START SCRIPT: $SCRIPT"
 
 
while [ -h "$SCRIPT" ] ; do
 
ls=$(ls -ld "$SCRIPT")
 
link=$(expr "$ls" : '.*-> \(.*\)$')
 
if expr "$link" : '/.*' > /dev/null; then
 
SCRIPT="$link"
 
else
 
SCRIPT=$(dirname "$SCRIPT")/"$link"
 
fi
 
done
 
 
if [ ! -d "${APP_DIR}" ]; then
 
APP_DIR=$(dirname "$SCRIPT")/..
 
APP_DIR=$(cd "${APP_DIR}"; pwd)
 
fi
 
 
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
 
 
if [ ! -f "$executable" ]
 
then
 
mvn clean package
 
fi
 
 
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
 
ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client -D dateLibrary=java8 -o samples/openapi3/client/petstore/kotlin $@"
 
 
echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin"
 
rm -rf samples/openapi3/client/petstore/kotlin
 
 
echo "Generating Kotling client..."
 
java $JAVA_OPTS -jar $executable $ags
modules/openapi-generator/src/main/resources/kotlin-client/api.mustache
+ 1
- 1
  • View file @ 071e3aab

  • Edit in single-file editor

  • Open in Web IDE


@@ -23,7 +23,7 @@ class {{classname}}(basePath: kotlin.String = "{{{basePath}}}") : ApiClient(base
@@ -23,7 +23,7 @@ class {{classname}}(basePath: kotlin.String = "{{{basePath}}}") : ApiClient(base
fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}} {
fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}} {
val localVariableBody: kotlin.Any? = {{#hasBodyParam}}{{#bodyParams}}{{paramName}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}null{{/hasFormParams}}{{#hasFormParams}}mapOf({{#formParams}}"{{{baseName}}}" to "${{paramName}}"{{#hasMore}}, {{/hasMore}}{{/formParams}}){{/hasFormParams}}{{/hasBodyParam}}
val localVariableBody: kotlin.Any? = {{#hasBodyParam}}{{#bodyParams}}{{paramName}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}null{{/hasFormParams}}{{#hasFormParams}}mapOf({{#formParams}}"{{{baseName}}}" to "${{paramName}}"{{#hasMore}}, {{/hasMore}}{{/formParams}}){{/hasFormParams}}{{/hasBodyParam}}
val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mapOf(){{/hasQueryParams}}{{#hasQueryParams}}mapOf({{#queryParams}}"{{baseName}}" to {{#isContainer}}toMultiValue({{paramName}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf("${{paramName}}"){{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/queryParams}}){{/hasQueryParams}}
val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mapOf(){{/hasQueryParams}}{{#hasQueryParams}}mapOf({{#queryParams}}"{{baseName}}" to {{#isContainer}}toMultiValue({{paramName}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf("${{paramName}}"){{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/queryParams}}){{/hasQueryParams}}
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf({{#hasFormParams}}"Content-Type" to "multipart/form-data"{{/hasFormParams}}{{^hasHeaderParams}}){{/hasHeaderParams}}{{#hasHeaderParams}}{{#hasFormParams}}, {{/hasFormParams}}{{#headerParams}}"{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(separator = collectionDelimiter("{{collectionFormat}}"){{/isContainer}}{{^isContainer}}{{paramName}}{{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/headerParams}}){{/hasHeaderParams}}
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf({{#hasFormParams}}"Content-Type" to "multipart/form-data"{{/hasFormParams}}{{^hasHeaderParams}}){{/hasHeaderParams}}{{#hasHeaderParams}}{{#hasFormParams}}, {{/hasFormParams}}{{#headerParams}}"{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}{{paramName}}{{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/headerParams}}){{/hasHeaderParams}}
val localVariableConfig = RequestConfig(
val localVariableConfig = RequestConfig(
RequestMethod.{{httpMethod}},
RequestMethod.{{httpMethod}},
"{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{paramName}}"){{/pathParams}},
"{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{paramName}}"){{/pathParams}},
samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION 0 → 100644
+ 1
- 0
  • View file @ 071e3aab

  • Edit in single-file editor

  • Open in Web IDE

 
4.0.0-SNAPSHOT
 
\ No newline at end of file
samples/openapi3/client/petstore/kotlin/docs/200_response.md 0 → 100644
+ 11
- 0
  • View file @ 071e3aab

  • Edit in single-file editor

  • Open in Web IDE

 
 
# Model200Response
 
 
## Properties
 
Name | Type | Description | Notes
 
------------ | ------------- | ------------- | -------------
 
**name** | **kotlin.Int** | | [optional]
 
**propertyClass** | **kotlin.String** | | [optional]
 
 
 
samples/openapi3/client/petstore/kotlin/docs/AdditionalPropertiesClass.md 0 → 100644
+ 11
- 0
  • View file @ 071e3aab

  • Edit in single-file editor

  • Open in Web IDE

 
 
# AdditionalPropertiesClass
 
 
## Properties
 
Name | Type | Description | Notes
 
------------ | ------------- | ------------- | -------------
 
**mapProperty** | **kotlin.collections.Map&lt;kotlin.String, kotlin.String&gt;** | | [optional]
 
**mapOfMapProperty** | **kotlin.collections.Map&lt;kotlin.String, kotlin.collections.Map&lt;kotlin.String, kotlin.String&gt;&gt;** | | [optional]
 
 
 
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
4
Breaking change (without fallback) Client: R Enhancement: Code Cleanup Enhancement: Code format
4
Breaking change (without fallback) Client: R Enhancement: Code Cleanup Enhancement: Code format
    Assign labels
  • Manage project labels

Milestone
6.0.0
6.0.0 (expired)
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference: OpenAPITools/openapi-generator!12387
Source branch: github/fork/ackintosh/fix-header-params

Menu

Explore Projects Groups Snippets