Add Elm script with Petstore OAS3 (#293)

* add elm script with petstore oas3

* change default value for elm generator

* update default value for elm templates

* fix typo
This commit is contained in:
William Cheng 2018-05-02 23:04:16 +08:00 committed by GitHub
parent 4ce97b6f4e
commit 95e04f91db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 56 additions and 24 deletions

32
bin/openapi3/elm-petstore.sh Executable file
View File

@ -0,0 +1,32 @@
#!/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
# if you've executed sbt assembly previously it will use that instead.
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.yaml -l elm -o samples/client/petstore/elm $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -48,7 +48,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
private Set<String> customPrimitives = new HashSet<String>(); private Set<String> customPrimitives = new HashSet<String>();
protected String packageName = "swagger"; protected String packageName = "openapi";
protected String packageVersion = "1.0.0"; protected String packageVersion = "1.0.0";
public CodegenType getTag() { public CodegenType getTag() {

View File

@ -2,10 +2,10 @@
{{#appDescription}} {{#appDescription}}
{{{appDescription}}} {{{appDescription}}}
{{/appDescription}}
{{/appDescription}}
## Overview ## Overview
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. This API client was generated by the [openapi-generator](https://github.com/openapitools/openapi-generator) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: {{appVersion}} - API version: {{appVersion}}
- Package version: {{packageVersion}} - Package version: {{packageVersion}}

View File

@ -5,7 +5,7 @@
{{#version}}OpenAPI spec version: {{{version}}}{{/version}} {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
{{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
NOTE: This file is auto generated by the swagger code generator program. NOTE: This file is auto generated by the openapi-generator.
https://github.com/swagger-api/swagger-codegen.git https://github.com/openapitools/openapi-generator.git
Do not edit this file manually. Do not edit this file manually.
-} -}

View File

@ -3,7 +3,7 @@
This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
## Overview ## Overview
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. This API client was generated by the [openapi-generator](https://github.com/openapitools/openapi-generator) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: 1.0.0 - API version: 1.0.0
- Package version: - Package version:

View File

@ -5,8 +5,8 @@
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
NOTE: This file is auto generated by the swagger code generator program. NOTE: This file is auto generated by the openapi-generator.
https://github.com/swagger-api/swagger-codegen.git https://github.com/openapitools/openapi-generator.git
Do not edit this file manually. Do not edit this file manually.
-} -}

View File

@ -5,8 +5,8 @@
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
NOTE: This file is auto generated by the swagger code generator program. NOTE: This file is auto generated by the openapi-generator.
https://github.com/swagger-api/swagger-codegen.git https://github.com/openapitools/openapi-generator.git
Do not edit this file manually. Do not edit this file manually.
-} -}

View File

@ -5,8 +5,8 @@
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
NOTE: This file is auto generated by the swagger code generator program. NOTE: This file is auto generated by the openapi-generator.
https://github.com/swagger-api/swagger-codegen.git https://github.com/openapitools/openapi-generator.git
Do not edit this file manually. Do not edit this file manually.
-} -}

View File

@ -5,8 +5,8 @@
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
NOTE: This file is auto generated by the swagger code generator program. NOTE: This file is auto generated by the openapi-generator.
https://github.com/swagger-api/swagger-codegen.git https://github.com/openapitools/openapi-generator.git
Do not edit this file manually. Do not edit this file manually.
-} -}

View File

@ -5,8 +5,8 @@
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
NOTE: This file is auto generated by the swagger code generator program. NOTE: This file is auto generated by the openapi-generator.
https://github.com/swagger-api/swagger-codegen.git https://github.com/openapitools/openapi-generator.git
Do not edit this file manually. Do not edit this file manually.
-} -}

View File

@ -5,8 +5,8 @@
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
NOTE: This file is auto generated by the swagger code generator program. NOTE: This file is auto generated by the openapi-generator.
https://github.com/swagger-api/swagger-codegen.git https://github.com/openapitools/openapi-generator.git
Do not edit this file manually. Do not edit this file manually.
-} -}

View File

@ -5,8 +5,8 @@
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
NOTE: This file is auto generated by the swagger code generator program. NOTE: This file is auto generated by the openapi-generator.
https://github.com/swagger-api/swagger-codegen.git https://github.com/openapitools/openapi-generator.git
Do not edit this file manually. Do not edit this file manually.
-} -}

View File

@ -5,8 +5,8 @@
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
NOTE: This file is auto generated by the swagger code generator program. NOTE: This file is auto generated by the openapi-generator.
https://github.com/swagger-api/swagger-codegen.git https://github.com/openapitools/openapi-generator.git
Do not edit this file manually. Do not edit this file manually.
-} -}

View File

@ -5,8 +5,8 @@
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
NOTE: This file is auto generated by the swagger code generator program. NOTE: This file is auto generated by the openapi-generator.
https://github.com/swagger-api/swagger-codegen.git https://github.com/openapitools/openapi-generator.git
Do not edit this file manually. Do not edit this file manually.
-} -}