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
  • #10247
Closed
Open
Issue created Aug 24, 2021 by Administrator@rootContributor4 of 6 checklist items completed4/6 checklist items

[BUG] [typescript-axios] common.ts is generated with syntax error

Created by: tjzeeman

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? Expected: correct syntax
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When upgrading my project to v5 the typescript-axios part caused compile issues due to the common.ts being generated with

import { RequiredError,?RequestArgs } from "./base";

This caused a syntax error and the build to give up.

openapi-generator version

Version 5.0.0, 5.2.0 and 5.2.1

Initial inspection suggests the cause of the issue is still present on the current master branch.

OpenAPI declaration file content or url
Generation Details

config.generatorName = 'typescript-axios'

Steps to reproduce

run gradle build to generate typescript-axios client

Related issues/PRs

None found at this moment.

Suggest a fix

The common.moustache file contains a Unicode character at the exact spot where the syntax error occurs import { RequiredError, RequestArgs } from "./base"

This character looks like a space in most editors, but is not. See this screenshot from IntelliJ where the character is represented with a boxed line around it: Screenshot 2021-08-24 at 10 49 23

replacing this character with an actual space character should fix this. PR is in the works.

Assignee
Assign to
Time tracking