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
  • #9828
Closed
Open
Issue created Jun 22, 2021 by Administrator@rootContributor

[BUG][Haskell] generates only 200 responses, response codes are ignored

Created by: mgajda

Description

Only 200 responses with non-empty content are correctly generated. All result codes are ignored.

openapi-generator version

Git commit: 77e1ca56cf329bfb22b05f853587263fd0ff6503 (June 16th 2021) Version in pom.xml is 5.2.0-SNAPSHOT.

OpenAPI declaration file content or url

Here is an example input spec:

openapi: 3.0.0
info:
  description: Minimal failing example
  version: "1.0.0"
  title: Minimal API
  contact:
    email: mjgajda@migamake.com

paths:
  /session:
    post:
      summary: start session
      operationId: startSession
      responses:
        '201':
          description: session created
          content:
            application/json:
              schema:
                type: object
                required:
                  - sessionId
                properties:
                  sessionId:
                    type: integer
                    example: 13
       '404':
          description: service offline
Generation Details

This will generate API that declares only the 200 response:

type MinimalAPI                                                                                                                                                           
    =    "session" :> Verb 'POST 200 '[JSON] InlineResponse201 -- 'startSession' route                                                                                    
    :<|> Raw
Steps to reproduce

Copy paste spec.yaml above and run:

openapi-generator-cli generate -i spec.yaml  -g haskell
Suggest a fix

This change of the generated code works:

type MinimalAPI                                                                                                                                                           
    =    "session" :> Verb 'POST 201 '[JSON] InlineResponse201 -- 'startSession' route                                                                                    
    :<|> Raw
Assignee
Assign to
Time tracking