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
  • #9968
Closed
Open
Issue created Jul 18, 2021 by Administrator@rootContributor

[dart][dart-dio-next] Models referenced in form parameters don't get generated

Created by: ahmednfwela

Description

Models referenced in form parameters don't get generated

openapi-generator version

5.2.0

OpenAPI declaration file content or url

Partial endpoint declaration (model name is ReqFileDesc):

"/v1.0/Api/Files/UploadFiles": {
      "post": {        
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    }
                  },
                  "fileDesc": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ReqFileDesc"
                    }
                  }
                }
              },
              "encoding": {
                "files": {
                  "style": "form"
                },
                "fileDesc": {
                  "style": "form"
                }
              }
            }
          }
        },      
      }
    },

ReqFileDesc model:

"ReqFileDesc": {
        "type": "object",
        "properties": {
          "friendlyName": {
            "type": "string",
            "nullable": true
          },
          "desc": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
Generation Details

The generated api file correctly imports the model file (at src/model/req_file_desc.dart), however the model file itself (src/model/req_file_desc.dart) is not generated and doesn't exist

Suggest a fix

the generator should generate all schemas included in the definition (even if they are not being referenced in the api)

Assignee
Assign to
Time tracking