Open HerrNiklasRaab opened 3 years ago
It's been quite some time since I looked at this, but I just ran a quick grep over my latest version of this repository and while you're right that I didn't implement --model-name-suffix in the template, the Abstract F# generator should have taken care of the model name suffix (so at the least it shouldn't be throwing an exception).
@HerrNiklasRaab this should be fixed in https://github.com/nmfisher/openapi-generator/tree/fsharp-giraffe-fixes
Are you able to test it out for me?
@nmfisher I did a test locally with your fix and no longer see any exceptions.
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g fsharp-giraffe-server --dry-run --model-name-suffix "Dto" -o /tmp/fsharp/
[main] INFO o.o.codegen.DefaultGenerator - Generating with dryRun=true
[main] INFO o.o.c.ignore.CodegenIgnoreProcessor - Output directory (/tmp/fsharp) does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.
[main] INFO o.o.codegen.DefaultGenerator - OpenAPI Generator: fsharp-giraffe-server (server)
[main] INFO o.o.codegen.DefaultGenerator - Generator 'fsharp-giraffe-server' is considered beta.
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
Please file a PR when you've time and I'll merge accordingly.
Thanks @wing328, amazing response time! There are a couple of other changes there so it needs a bit more testing but will look to file a PR soon.
When running this commande
openapi-generator generate -i api.yml -g fsharp-giraffe-server --dry-run --model-name-suffix "Dto"
I get the following exception:When I run it with any other generator, I don't get the exception:
openapi-generator generate -i api.yml -g aspnetcore --dry-run --model-name-suffix "Dto"
When I run it without
--model-name-suffix
, I don't get the exception:openapi-generator generate -i api.yml -g fsharp-giraffe-server --dry-run
@nmfisher Could it be that this option is not supported yet for the F# generator?