Skip to content
GitLab
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
  • Issues
  • #113
Closed
Open
Issue created May 20, 2018 by Jim Schubert@jimschubertContributor

Update samples scripts to move args ($@) to end of script text

Description

$@ in our sample scripts should exist at the end of ags. Moving these to the end of ags allows maintainers to evaluate different generator options more easily.

Example (of a script supporting this):

./bin/kotlin-client-petstore.sh --additional-properties dateLibrary=string

This allows maintainers to easily see changes for different options:

$ git diff
diff --git a/samples/client/petstore/kotlin/docs/Order.md b/samples/client/petstore/kotlin/docs/Order.md
index ef31dbf2f..4683c14c1 100644
--- a/samples/client/petstore/kotlin/docs/Order.md
+++ b/samples/client/petstore/kotlin/docs/Order.md
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
 **id** | **kotlin.Long** |  |  [optional]
 **petId** | **kotlin.Long** |  |  [optional]
 **quantity** | **kotlin.Int** |  |  [optional]
-**shipDate** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) |  |  [optional]
+**shipDate** | **kotlin.String** |  |  [optional]
 **status** | [**inline**](#StatusEnum) | Order Status |  [optional]
 **complete** | **kotlin.Boolean** |  |  [optional]

diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt
index 44a8b1f89..5e5696bbc 100644
--- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt
+++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt
@@ -26,7 +26,7 @@ data class Order (
     val id: kotlin.Long? = null,
     val petId: kotlin.Long? = null,
     val quantity: kotlin.Int? = null,
-    val shipDate: java.time.LocalDateTime? = null,
+    val shipDate: kotlin.String? = null,
     /* Order Status */
     val status: Order.Status? = null,
     val complete: kotlin.Boolean? = null

In bash, $@ is an array holding arguments to the calling script-- essentially argv.

Most of our samples scripts pass the args before the CLI's generate command:

ags="$@ generate -l aspnetcore \
    -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml \ 
    -o samples/server/petstore/aspnetcore \
    --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5}"

This doesn't make a lot of sense because the only option we're allowed to pass HERE:

java -jar openapi-generator-cli.jar HERE generate …

Is help. All other options will fail.

Any other special properties allowed by the generator are system properties. Bash already allows this:

JAVA_OPTS=-DdebugOpenAPI=true ./bin/aspnetcore-petstore-server.sh 
# or 
env JAVA_OPTS=-DdebugOpenAPI=true ./bin/aspnetcore-petstore-server.sh 
openapi-generator version

n/a

OpenAPI declaration file content or url

n/a

Command line used for generation

n/a

Steps to reproduce

n/a

Related issues/PRs

n/a

Suggest a fix/enhancement

see description

Assignee
Assign to
Time tracking