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
  • #14022
Closed
Open
Issue created Nov 15, 2022 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG] [typescript-fetch] Undefined members imported in models when withoutRuntimeChecks is on

Created by: umbopepato

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

When the withoutRuntimeChecks option is on, the missing members exists and mapValues are imported from runtime.ts in models, causing a TS compilation error:

image

Those two exports are in fact not defined when the mentioned option is on:

https://github.com/OpenAPITools/openapi-generator/blob/b9a6be0cba2fc21913bafba60a69e7815a336b98/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache#L278-L283

https://github.com/OpenAPITools/openapi-generator/blob/b9a6be0cba2fc21913bafba60a69e7815a336b98/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache#L312-L319

openapi-generator version

6.2.1

OpenAPI declaration file content or url
Generation Details
$ openapi-generator [...] --additional-properties=withoutRuntimeChecks
                                                  ^^^^^^^^^^^^^^^^^^^^
Steps to reproduce
  • Generate a typescript-fetch client with the withoutRuntimeChecks option on.
  • Run TS compilation on generated files.
Related issues/PRs
Suggest a fix

PR #14024 fixes this

Assignee
Assign to
Time tracking