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
  • #10802
Closed
Open
Issue created Nov 07, 2021 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG][csharp] client fails to compile for multi-file upload

Created by: malesh

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

See issue #9767. A client generated from a spec that includes multiple files in the signature generates invalid code. The generated client code has the correct method signature but attempts to add the list of files to the FileParameters instead of adding each file individually causing a compile error.

openapi-generator version

master

OpenAPI declaration file content or url

Taken from issue #9767:

openapi: 3.0.3
info:
  title: bug example
  version: 0.0.1
paths:
  /example:
    post:
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                filename:
                  type: array
                  items:
                    type: string
                    format: binary
      responses:
        '200':
          description: OK
Generation Details

java -jar openapi-generator-cli.jar generate --input-spec example.yml --generator-name csharp-netcore -o output

Steps to reproduce

Project fails to compile due to error:

cannot convert from 'System.Collections.Generic.List<System.IO.Stream>' to 'System.IO.Stream'
Related issues/PRs

See issue #9767

Suggest a fix

Each file needs to be added to the FileParameters individually.

Assignee
Assign to
Time tracking