Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OCaml] new client generator #3446

Merged
merged 40 commits into from Jul 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8ad109e
Début d'un générateur pour OCaml.
Jul 12, 2019
6eee563
Ajout du script bash de generation pour OCaml.
Jul 13, 2019
428f682
Implémentation de la partie model du générateur OCaml.
cgensoul Jul 16, 2019
80dcf79
Suppression du fichier Model.mustache.
Jul 16, 2019
305c9aa
Légère modification dans le générateur OCaml.
Jul 16, 2019
8de8ef6
Début d'implémentation de la génération des opérations.
cgensoul Jul 16, 2019
ee3cef7
Avancées dans l'implémenatation des opérations.
cgensoul Jul 17, 2019
6d954f7
Avancée dans la gestion des enums : reste à traiter le fait que Yojso…
Jul 18, 2019
06619ac
Prise en compte du fait que Yojson représente les variants constants …
cgensoul Jul 18, 2019
b2cb9a2
Utilisation des variants polymorphe pour les enums car il se peut que…
Jul 19, 2019
8346f9f
Avancées dans le générateur de code OCaml : le code produit compile e…
Jul 19, 2019
80a9884
More tests.
Jul 19, 2019
5c7e0e0
Correction de problèmes dans la génération mis en évidence par l'util…
Jul 22, 2019
ef6c19c
Mapping du case Error de Ppx_deriving_yojson_runtime.ok_error vers l'…
Jul 22, 2019
83d0d17
Ajout de la génération des fichiers d'interfaces .mli pour les APIs.
Jul 22, 2019
afcfc1a
Ajout du support des parametres de type x-www-form-urlencoded.
Jul 23, 2019
4c63dfe
Le paramètres d'url de type number étaient mal gérés.
Jul 23, 2019
4f1f2fc
Cleanup.
Jul 23, 2019
55c81ef
Replace block comment start and end sequences in input text.
Jul 23, 2019
aa978f6
Make apis calls without a return type return unit rather than Yojson.…
Jul 23, 2019
28477e6
Make modules/openapi-generator/src/test/resources/3_0/petstore-with-f…
Jul 24, 2019
382eefe
Better handling of enums and map container and better sanitizing of g…
Jul 24, 2019
cce2152
Added generated code for modules/openapi-generator/src/test/resources…
Jul 24, 2019
eaad2bc
Correcting a violation : using toLowerCase without relying on the def…
Jul 24, 2019
c723573
Changed authoring in partial_header.mustache.
Jul 24, 2019
391de4e
Deleted commented code.
Jul 24, 2019
9287c8e
Collect enum schemas in items properties of operation parameters in t…
cgensoul Jul 24, 2019
b0b943b
Collect enums also in additional properties schemas of operation para…
cgensoul Jul 24, 2019
ba65b78
Removed copy-pasted Copyright notice from SmartBear.
cgensoul Jul 25, 2019
277822c
update doc
wing328 Jul 25, 2019
d80f22a
Use Locale.ROOT instead of Locale.ENGLISH for toLowerCase calls.
Jul 25, 2019
55bcfb7
Make GET operations with body generate compilable code.
Jul 25, 2019
67a2b38
Updated ocaml-client generated samples using the latest version of th…
Jul 25, 2019
b9545de
Added [@default None] for record fields with option types so that if …
Jul 25, 2019
70762d4
Added support of api keys in query params.
Jul 25, 2019
2b093bd
Updated generated ocaml samples to reflect latest changes in templates.
Jul 25, 2019
a2073f1
Added [@default] on enum record fields for which the enum type has on…
Jul 26, 2019
ecc8922
Delete useless space character in template.
cgensoul Jul 27, 2019
c4535f4
Added proper handling of http response codes.
cgensoul Jul 27, 2019
4b5d0aa
Updated generated ocaml samples to reflect latest changes in templates.
cgensoul Jul 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 34 additions & 0 deletions bin/ocaml-client-petstore.sh
@@ -0,0 +1,34 @@
#!/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 -B clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DdebugOperations -DloggerPath=conf/log4j.properties"

args="generate -t modules/openapi-generator/src/main/resources/ocaml-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ocaml-client -o samples/client/petstore/ocaml-client --additional-properties packageName=petstore_client $@"

echo "java ${JAVA_OPTS} -jar ${executable} ${args}"
java $JAVA_OPTS -jar $executable $args
34 changes: 34 additions & 0 deletions bin/openapi3/ocaml-client-petstore.sh
@@ -0,0 +1,34 @@
#!/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 -B clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DdebugOperations -DloggerPath=conf/log4j.properties"

args="generate -t modules/openapi-generator/src/main/resources/ocaml-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ocaml-client -o samples/openapi3/client/petstore/ocaml-client/ --additional-properties packageName=petstore_client $@"

echo "java ${JAVA_OPTS} -jar ${executable} ${args}"
java $JAVA_OPTS -jar $executable $args
1 change: 1 addition & 0 deletions docs/generators.md
Expand Up @@ -39,6 +39,7 @@ The following generators are available:
- [kotlin](generators/kotlin.md)
- [lua](generators/lua.md)
- [objc](generators/objc.md)
- [ocaml-client](generators/ocaml-client.md)
- [perl](generators/perl.md)
- [php](generators/php.md)
- [powershell](generators/powershell.md)
Expand Down
13 changes: 13 additions & 0 deletions docs/generators/ocaml-client.md
@@ -0,0 +1,13 @@

---
id: generator-opts-client-ocaml-client
title: Config Options for ocaml-client
sidebar_label: ocaml-client
---

| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|