forked from loafle/openapi-generator-original
update erlang client with oas3 (#182)
This commit is contained in:
parent
edbe4902a4
commit
35f0cc221d
31
bin/openapi3/erlang-petstore-client.sh
Executable file
31
bin/openapi3/erlang-petstore-client.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
|
||||||
|
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 -t modules/openapi-generator/src/main/resources/erlang-client -DpackageName=petstore -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l erlang-client -o samples/client/petstore/erlang-client"
|
||||||
|
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
@ -86,7 +86,7 @@ place_order(Ctx, PetstoreOrder, Optional) ->
|
|||||||
QS = [],
|
QS = [],
|
||||||
Headers = [],
|
Headers = [],
|
||||||
Body1 = PetstoreOrder,
|
Body1 = PetstoreOrder,
|
||||||
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
||||||
Opts = maps:get(hackney_opts, Optional, []),
|
Opts = maps:get(hackney_opts, Optional, []),
|
||||||
|
|
||||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
@ -27,7 +27,7 @@ create_user(Ctx, PetstoreUser, Optional) ->
|
|||||||
QS = [],
|
QS = [],
|
||||||
Headers = [],
|
Headers = [],
|
||||||
Body1 = PetstoreUser,
|
Body1 = PetstoreUser,
|
||||||
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
||||||
Opts = maps:get(hackney_opts, Optional, []),
|
Opts = maps:get(hackney_opts, Optional, []),
|
||||||
|
|
||||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
@ -48,7 +48,7 @@ create_users_with_array_input(Ctx, PetstoreUserArray, Optional) ->
|
|||||||
QS = [],
|
QS = [],
|
||||||
Headers = [],
|
Headers = [],
|
||||||
Body1 = PetstoreUserArray,
|
Body1 = PetstoreUserArray,
|
||||||
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
||||||
Opts = maps:get(hackney_opts, Optional, []),
|
Opts = maps:get(hackney_opts, Optional, []),
|
||||||
|
|
||||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
@ -69,7 +69,7 @@ create_users_with_list_input(Ctx, PetstoreUserArray, Optional) ->
|
|||||||
QS = [],
|
QS = [],
|
||||||
Headers = [],
|
Headers = [],
|
||||||
Body1 = PetstoreUserArray,
|
Body1 = PetstoreUserArray,
|
||||||
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
||||||
Opts = maps:get(hackney_opts, Optional, []),
|
Opts = maps:get(hackney_opts, Optional, []),
|
||||||
|
|
||||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
@ -174,7 +174,7 @@ update_user(Ctx, Username, PetstoreUser, Optional) ->
|
|||||||
QS = [],
|
QS = [],
|
||||||
Headers = [],
|
Headers = [],
|
||||||
Body1 = PetstoreUser,
|
Body1 = PetstoreUser,
|
||||||
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
||||||
Opts = maps:get(hackney_opts, Optional, []),
|
Opts = maps:get(hackney_opts, Optional, []),
|
||||||
|
|
||||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user