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
  • !2802

Add beta server stub generator for F#/Giraffe

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged William Cheng requested to merge f-sharp-server into master 6 years ago
  • Overview 0
  • Commits 6
  • Pipelines 0
  • Changes 65

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, ./bin/openapi3/{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

Add beta server stub generator for F#/Giraffe

Compare
  • master (base)

and
  • latest version
    5496e445
    6 commits, 2 years ago

65 files
+ 5725
- 0

    Preferences

    File browser
    Compare changes
b‎in‎
win‎dows‎
fsharp-giraffe-se‎rver-petstore.bat‎ +10 -0
fsharp-giraffe-s‎erver-petstore.sh‎ +32 -0
do‎cs‎
gener‎ators‎
fsharp-g‎iraffe.md‎ +25 -0
genera‎tors.md‎ +1 -0
modules/openap‎i-generator/src‎
ma‎in‎
java/org/openapitoo‎ls/codegen/languages‎
AbstractFShar‎pCodegen.java‎ +1154 -0
FsharpGiraffeSe‎rverCodegen.java‎ +287 -0
reso‎urces‎
META-INF‎/services‎
org.openapitools.co‎degen.CodegenConfig‎ +1 -0
fsharp-gir‎affe-server‎
AuthScheme‎s.mustache‎ +100 -0
CustomHandl‎ers.mustache‎ +112 -0
Handler.‎mustache‎ +67 -0
HandlerPara‎ms.mustache‎ +147 -0
HandlerTes‎ts.mustache‎ +65 -0
HandlerTestsH‎elper.mustache‎ +46 -0
Helpers.‎mustache‎ +12 -0
Model.m‎ustache‎ +36 -0
Program.‎mustache‎ +100 -0
Project.Tests.‎fsproj.mustache‎ +32 -0
Project.fsp‎roj.mustache‎ +44 -0
README.‎mustache‎ +198 -0
ServiceImp‎l.mustache‎ +44 -0
ServiceInter‎face.mustache‎ +17 -0
TestHelpe‎r.mustache‎ +83 -0
build.bat‎.mustache‎ +3 -0
build.sh‎.mustache‎ +4 -0
gitignore‎.mustache‎ +5 -0
test/java/org/…‎/codegen/fsharp‎
FSharpServerCo‎degenTest.java‎ +94 -0
samples/server/pets‎tore/fsharp-giraffe‎
.openapi-‎generator‎
VER‎SION‎ +1 -0
Ope‎nAPI‎
s‎rc‎
a‎pi‎
PetApiHa‎ndler.fs‎ +179 -0
PetApiHandl‎erParams.fs‎ +213 -0
PetApiServic‎eInterface.fs‎ +20 -0
StoreApiH‎andler.fs‎ +97 -0
StoreApiHand‎lerParams.fs‎ +88 -0
StoreApiServi‎ceInterface.fs‎ +16 -0
UserApiH‎andler.fs‎ +173 -0
UserApiHand‎lerParams.fs‎ +169 -0
UserApiServic‎eInterface.fs‎ +20 -0
au‎th‎
AuthSch‎emes.fs‎ +88 -0
hel‎pers‎
Helpe‎rs.fs‎ +12 -0
im‎pl‎
CustomHa‎ndlers.fs‎ +112 -0
PetApiSe‎rvice.fs‎ +72 -0
StoreApiS‎ervice.fs‎ +49 -0
UserApiS‎ervice.fs‎ +68 -0
mo‎del‎
ApiResp‎onse.fs‎ +17 -0
Categ‎ory.fs‎ +16 -0
InlineO‎bject.fs‎ +16 -0
InlineOb‎ject1.fs‎ +16 -0
Orde‎r.fs‎ +23 -0
Pet‎.fs‎ +25 -0
Tag‎.fs‎ +16 -0
Use‎r.fs‎ +22 -0
OpenAPI‎.fsproj‎ +49 -0
Progr‎am.fs‎ +109 -0
.giti‎gnore‎ +5 -0
READ‎ME.md‎ +186 -0
buil‎d.bat‎ +3 -0
buil‎d.sh‎ +4 -0
OpenAP‎I.Tests‎
OpenAPITe‎sts.fsproj‎ +32 -0
PetApiT‎ests.fs‎ +295 -0
PetApiTest‎sHelper.fs‎ +117 -0
StoreApi‎Tests.fs‎ +173 -0
StoreApiTes‎tsHelper.fs‎ +42 -0
TestHe‎lper.fs‎ +83 -0
UserApi‎Tests.fs‎ +272 -0
UserApiTes‎tsHelper.fs‎ +85 -0
.openapi-gen‎erator-ignore‎ +23 -0
bin/windows/fsharp-giraffe-server-petstore.bat 0 → 100644
+ 10
- 0
  • View file @ 5496e445

  • Edit in single-file editor

  • Open in Web IDE

set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
If Not Exist %executable% (
mvn clean package
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
set ags=generate --artifact-id "fsharp-giraffe-petstore-server" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g fsharp-giraffe -o samples\server\petstore\fsharp-giraffe
java %JAVA_OPTS% -jar %executable% %ags%
bin/fsharp-giraffe-server-petstore.sh 0 → 100755
+ 32
- 0
  • View file @ 5496e445

  • 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
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -t modules/openapi-generator/src/main/resources/fsharp-giraffe-server -g fsharp-giraffe -o samples/server/petstore/fsharp-giraffe $@"
java ${JAVA_OPTS} -jar ${executable} ${ags}
docs/generators/fsharp-giraffe.md 0 → 100644
+ 25
- 0
  • View file @ 5496e445

  • Edit in single-file editor

  • Open in Web IDE

---
id: generator-opts-server-fsharp-giraffe
title: Config Options for fsharp-giraffe
sidebar_label: fsharp-giraffe
---
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|licenseUrl|The URL of the license| |http://localhost|
|licenseName|The name of the license| |NoLicense|
|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright|
|packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI|
|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library|
|packageName|F# module name (convention: Title.Case).| |OpenAPI|
|packageVersion|F# package version.| |1.0.0|
|packageGuid|The GUID that will be associated with the C# project| |null|
|sourceFolder|source folder for generated code| |OpenAPI/src|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false|
|returnICollection|Return ICollection<T> instead of the concrete type.| |false|
|useSwashbuckle|Uses the Swashbuckle.AspNetCore NuGet package for documentation.| |false|
|generateBody|Generates method body.| |true|
|buildTarget|Target the build for a program or library.| |program|
docs/generators.md
+ 1
- 0
  • View file @ 5496e445

  • Edit in single-file editor

  • Open in Web IDE


@@ -71,6 +71,7 @@ The following generators are available:
- [cpp-restbed-server](generators/cpp-restbed-server.md)
- [csharp-nancyfx](generators/csharp-nancyfx.md)
- [erlang-server](generators/erlang-server.md)
- [fsharp-giraffe](generators/fsharp-giraffe.md)
- [go-gin-server](generators/go-gin-server.md)
- [go-server](generators/go-server.md)
- [graphql-nodejs-express-server](generators/graphql-nodejs-express-server.md)
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java 0 → 100644
+ 1154
- 0
  • View file @ 5496e445

  • Edit in single-file editor

  • Open in Web IDE

Files with large changes are collapsed by default.

0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference: PyAV-Org/PyAV!435
Source branch: f-sharp-server

Menu

Explore Projects Groups Snippets