Skip to content

[Ada] Client call is not correct with multiple parameters and application/x-www-urlencoded #7511

@stcarrez

Description

@stcarrez
Description

For the Ada client generator, when a REST operation uses application/x-www-urlencoded and several parameters the submitted body is sent empty. The client code compiles but it is not correct.

Swagger-codegen version

Version 2.4.0

Swagger declaration file content or url

The following operation will have incorrect code generated and the server will receive an empty body even if all parameters are passed to the Ada procedure.

post:
  tags:
    - ticket
  summary: Create a ticket
  description: ''
  operationId: do_create_ticket
  consumes:
    - application/x-www-form-urlencoded
  produces:
    - application/json
  parameters:
    - name: owner
      in: formData
      description: Ticket owner
      required: false
      type: string
    - name: status
      in: formData
      description: Ticket status
      required: false
      type: string
      enum: [open assigned closed]
    - name: title
      in: formData
      description: Ticket title
      required: true
      type: string
    - name: description
      in: formData
      description: Ticket description
      required: false
      type: string
  responses:
    '201':
      description: ticket created
      headers:
        Location:
          description: The URL of the new ticket
          type: string
    '405':
      description: Invalid input
  security:
    - ticket_auth:
        - 'write:ticket'
Command line used for generation
java -jar swagger-codegen-cli.jar generate \
       -l ada -i regtests/swagger.yaml -o regtests/client \
       -DprojectName=TestAPI --model-package TestAPI
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

The generated code initialized the request but "forgets" to pass it to the Call procedure, thus submitting an empty body...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions