[CSHARP] Multi Level inheritance is not building
Created by: mdulisch
Description
If you build a definition with multiple level inheritance, the compiler will not build the generated code. There are two problems.
- the constructor only has the readWrite variables (no possibility to set read only variables)
- The "parentVars" list of the model of the generator does only list the vars of the direct parent.
openapi-generator version
3.2.3
OpenAPI declaration file content or url
openapi: 3.0.1
info:
version: 1.0.0
title: Inheritence test
description: Test
paths:
/v1/post-child:
post:
responses:
200:
description: OK
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SecondChild'
description: The actual event resource.
required: true
components:
schemas:
Parent:
description: the base Parent
required:
- secondProperty
properties:
firstProperty:
description: readonly string
type: string
readOnly: true
secondProperty:
description: required datetime
type: string
format: date-time
FirstChild:
description: The first child
allOf:
- $ref: '#/components/schemas/Parent'
- required:
- thirdProperty
properties:
thirdProperty:
description: Required Property
type: string
maxLength: 36
SecondChild:
allOf:
- $ref: '#/components/schemas/FirstChild'
- required:
- fourthProperty
properties:
fourthProperty:
description: required Fourth Property
type: string
Command line used for generation
java -jar .\openapi-generator-cli-3.2.3.jar generate -g csharp -i openapi.yaml
Steps to reproduce
Just generate the code and try to build