Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #1068
Closed
Open
Issue created Sep 20, 2018 by Administrator@rootContributor

[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.

  1. the constructor only has the readWrite variables (no possibility to set read only variables)
  2. 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

Related issues/PRs
Suggest a fix/enhancement
Assignee
Assign to
Time tracking