Open acandylevey opened 5 months ago
can you please share the spec (minimal) to reproduce the issue?
I tired to reproduce with allOf in request/response but couldn't.
I ran into this issue when using version 7.0.1 of the cli, updating to the latest 7.7.0 fixed it
Bug Report Checklist
Description
When generating the C# client when the request body has been put into a
allOf
via a$ref
the generated code always containedUNKNOWN_BASE_TYPE
.This changed recently in our code base as we started using
config.UseAllOfToExtendReferenceSchemas();
with Swashbuckle.Prior to this, we always generated our schema as below which didn't cause any issues.
openapi-generator version
7.3.0
OpenAPI declaration file content or url
Generation Details
openapi-generator-cli generate -i .\api-swagger.json -g csharp -o ./client -p disallowAdditionalPropertiesIfNotPresent=false -p targetFramework=net6.0 -p packageName=Org.Domain.Api-p netCoreProjectFile=true -p nullableReferenceTypes=true -p useCollection=true -p library=httpclient -p useSingleRequestParameter=true
Steps to reproduce
Generate with the above yaml and you'll get
UNKNOWN_BASE_TYPE
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/issues/2236