Skip to content

[csharp] localVarHttpHeaderAccepts list not being generated correctly #361

@alexl0gan

Description

@alexl0gan
Description

localVarHttpHeaderAccepts list not being generated correctly. List is missing brackets and contains titles of example responses.

openapi-generator version

3.0.2

OpenAPI declaration file content or url
'/v3/example':
    post:
      summary: example
      parameters:
        - in: body
          name: identity
          schema:
            $ref: '#/definitions/Id'
          required: true
      description: description
      tags:
        - Public API
      responses:
        201:
          description: created
          schema:
            $ref: '#/definitions/Identity'
          examples:
            'Success':
              object: 'example'
        400:
          description: Bad request. The enrollment identity is not valid.
          schema:
            $ref: '#/definitions/ErrorResponse'
        401:
          description: The provided access token is not valid.
          schema:
            $ref: '#/definitions/ErrorResponse'
          examples:
            'Authentication Error':
              object: 'error'
        409:
          description: |
            Conflict.
            $ref: '#/definitions/ErrorResponse'
          examples:
            'Conflict':
              object: 'error'
            'Already claimed':
              object: 'error'

This produces

// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
    "application/json",
    "Success"
    "Authentication Error",
    "Already claimed",
    "Conflict",
};

This occurred after migrating from swagger codegen 2.2.3.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions