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
  • #12510
Closed
Open
Issue created Jun 02, 2022 by Administrator@rootContributor4 of 6 checklist items completed4/6 checklist items

[BUG][TypeScript fetch] "oneOf" in query parameter generates wrong code

Created by: targos

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

In version 6.0.0, if oneOf is used in the schema for a query parameter, the generated code is wrong in a few ways:

  • The file which contains the type definition for the parameter also has code referencing functions that do not exist: image
  • The interface generated for the query parameters uses the type from that file but doesn't import it: image
openapi-generator version

6.0.0. This is a regression from version 5.4.0.

OpenAPI declaration file content or url

https://gist.github.com/targos/ce0dcf58be520f94c1bdab868f14e17b

Generation Details
{
  "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,
  "generator-cli": {
    "version": "6.0.0",
    "generators": {
      "typescript-fetch": {
        "generatorName": "typescript-fetch",
        "glob": "openapi.json",
        "output": "test/api",
        "additionalProperties": {
          "enumPropertyNaming": "UPPERCASE"
        }
      }
    }
  }
}
Steps to reproduce
npm install -D @openapitools/openapi-generator-cli
npx openapi-generator-cli generate
Related issues/PRs
Suggest a fix
Assignee
Assign to
Time tracking