We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When generating the C# client when the request body has been put into a allOf via a $ref the generated code always contained UNKNOWN_BASE_TYPE.
allOf
$ref
UNKNOWN_BASE_TYPE
This changed recently in our code base as we started using config.UseAllOfToExtendReferenceSchemas(); with Swashbuckle.
config.UseAllOfToExtendReferenceSchemas();
Prior to this, we always generated our schema as below which didn't cause any issues.
application/json: schema: $ref: '#/components/schemas/CustomRequest'
7.3.0
/api/custom-endpoint: post: requestBody: content: application/json-patch+json: schema: allOf: - $ref: '#/components/schemas/CustomRequest' application/json: schema: allOf: - $ref: '#/components/schemas/CustomRequest' text/json: schema: allOf: - $ref: '#/components/schemas/CustomRequest' application/*+json: schema: allOf: - $ref: '#/components/schemas/CustomRequest' responses: "200": content: text/plain: schema: items: $ref: '#/components/schemas/CustomResponse' type: array application/json: schema: items: $ref: '#/components/schemas/CustomResponse' type: array text/json: schema: items: $ref: '#/components/schemas/CustomResponse' type: array description: Success security: - API-Key: [] tags: - CustomTag
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
Generate with the above yaml and you'll get UNKNOWN_BASE_TYPE
#2236
The text was updated successfully, but these errors were encountered:
can you please share the spec (minimal) to reproduce the issue?
I tired to reproduce with allOf in request/response but couldn't.
Sorry, something went wrong.
I ran into this issue when using version 7.0.1 of the cli, updating to the latest 7.7.0 fixed it
No branches or pull requests
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
#2236
The text was updated successfully, but these errors were encountered: