OpenAPITools / OpenAPITools/openapi-generator
[BUG] Upgrading to 5.0 beta3 (from beta2) introduced the following error with csharp-netcore generation (net50 not in supported versions)
Open
Nobody has claimed this yet.
Issue: Bug
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Command:
openapi-generator-cli generate -i $SWAGGER_FILE -g csharp-netcore -o $output -c $configFile --git-repo-id=$GIT_REPO --git-user-id=$GIT_USER \
--additional-properties=packageVersion=$VERSION,packageName=$packageName
Output:
Exception in thread "main" java.lang.IllegalArgumentException: Invalid .NET framework version: net5.0. List of supported versions: netstandard1.3, netstandard1.4, netstandard1.5, netstandard1.6, netstandard2.0, netstandard2.1, netcoreapp2.0, netcoreapp2.1, netcoreapp3.0, netcoreapp3.1, net47
at org.openapitools.codegen.languages.CSharpNetCoreClientCodegen.processOpts(CSharpNetCoreClientCodegen.java:579)
at org.openapitools.codegen.DefaultGenerator.configureGeneratorProperties(DefaultGenerator.java:250)
at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:862)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:432)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
Config File:
{
"targetFramework": "net5.0"
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at CSharpNetCoreClientCodegen.java:579, where processOpts rejects the targetFramework value from the supplied config file. Check how supported .NET framework versions are validated for csharp-netcore generation. Done means the shown command accepts net5.0 and completes generation without the reported exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100