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
  • #6350
Closed
Open
Issue created May 18, 2020 by Administrator@rootContributor5 of 5 checklist items completed5/5 checklist items

[BUG] [haskell-http-client] Using a schema reference for an optional form parameter of a request body results in broken code

Created by: typetetris

Bug Report Checklist

  • Provided a broken spec.
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
Description

Using a schema reference for an optional form parameter of a request body results in broken code.

I expected compiling code.

openapi-generator version

From Commit 6c5621d9 (HEAD of master at the moment)

OpenAPI declaration file content or url
openapi: 3.0.2
info:
  title: Example
  description: Example to demonstrate issues with optional parameters for haskell-http-client
  contact:
    name: example
    url: https://www.example.example
    email: example@test.test
  license:
    name: whateveryouneed
    url: https://www.example.example
  version: 0.0.1
servers: []
paths:
  /example:
    post:
      tags:
        - example
      description: Example
      operationId: exampleOp
      requestBody:
        description: example
        required: true
        content:
          'application/x-www-form-urlencoded':
            schema:
              type: object
              properties:
                example:
                  $ref: '#/components/schemas/Example'
      responses:
        '204':
          description: Success
components:
  schemas:
    "Example":
      title: ExampleEnum
      type: string
      enum:
        - "Value1"
        - "Value2"
        - "Value3"
      description: ''
Command line used for generation
openapi-generator-cli generate -o test -i example.yaml -g haskell-http-client
Steps to reproduce
cd test
cabal build
Related issues/PRs

none to my knowledge

Suggest a fix

pr incoming. There is a completely arbitrary if condition in the code, with no else branch and the else case leaves some vendor extensions thingies uninitialised.

Assignee
Assign to
Time tracking