OpenAPITools / OpenAPITools/openapi-generator
csharp-netcore - If properties are equal in schemas does not create all class model
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Spec Json File:
{
"info": {
"contact": {},
"description": ".",
"version": "1.0.0",
"title": "Building Blocks"
},
"paths": {
"/resource-group/v2.0.0": {
"post": {
"description": "resource-group_create",
"tags": [
"resource-group"
],
"x-codegen-request-body-name": "extra_vars",
"deprecated": false,
"summary": "This Building Block allows the user to Update: resource-group",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/resource-group_create_v2.0.0"
}
}
}
},
"responses": {
"200": {
"content": {},
"description": "OK"
}
}
}
},
"/resource-group/v2.0.1": {
"post": {
"description": "resource-group_create",
"tags": [
"resource-group"
],
"x-codegen-request-body-name": "extra_vars",
"deprecated": false,
"summary": "This Building Block allows the user to Update: resource-group",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/resource-group_create_v2.0.1"
}
}
}
},
"responses": {
"200": {
"content": {},
"description": "OK"
}
}
}
}
},
"tags": [],
"openapi": "3.0.3",
"components": {
"schemas": {
"resource-group_create_v2.0.1": {
"xml": {
"wrapped": false,
"attribute": false,
"name": "resource-group"
},
"type": "object",
"properties": {
"credentials": {
"type": "Array"
},
"extra_vars": {
"required": [
"var_subscriptionId",
"var_productApp"
],
"type": "object",
"properties": {
"var_subscriptionId": {
"mandatory": true,
"type": "string",
"description": null
},
"var_productApp": {
"mandatory": true,
"type": "string",
"description": null
}
}
}
},
"title": "resource-group_create_v2.0.1"
},
"resource-group_create_v2.0.0": {
"xml": {
"wrapped": false,
"attribute": false,
"name": "resource-group"
},
"type": "object",
"properties": {
"credentials": {
"type": "Array"
},
"extra_vars": {
"required": [
"var_subscriptionId",
"var_productApp"
],
"type": "object",
"properties": {
"var_subscriptionId": {
"type": "string",
"mandatory": true,
"description": null
},
"var_productApp": {
"type": "string",
"mandatory": true,
"description": null
}
}
}
},
"title": "resource-group_create_v2.0.0"
}
}
},
"servers": [
{
"url": ""
}
]
}
Command:
docker run openapitools/openapi-generator-cli:v6.0.0 generate -i /local/spec.json -c /local/config.json -g csharp-netcore -o /local/bb-sdk --skip-validate-spec
Model result:

ResourceGroupCreateV200ExtraVars.cs -> Is not Created!
Because the "properties"
are the same in both schemas
Is there a way to Force that?
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 by rerunning the provided Docker command with spec.json and config.json using the csharp-netcore generator, then compare the generated models for the two schemas. Investigate why the identical extra_vars properties result in only one ResourceGroupCreateV200ExtraVars.cs model. Done means both schema models are generated or the behavior is clearly documented as intentional.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, docker
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100