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
  • #1046
Closed
Open
Issue created Sep 16, 2018 by Administrator@rootContributor

Javascript modules, autocomplete does not work

Created by: bgadrian

Hello,

I have an issue with the Javascript generated client. I cannot make the autocomplete (intellij or intellisense) to recognize the generated modules (api or models).

vscode-no-type

I tried all the supported settings with a custom jsconfig https://code.visualstudio.com/docs/languages/jsconfig

Even if I write explicitely the type /** @type {api/DashboardApi} */ it still doesn't recognize it, the type is "any".

openapi-generator version

3.3.0-SNAPSHOT (docker image)

repro steps
  1. Run
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate \
    -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
    -g javascript \
    -o /local/out/javascript
  1. change the owner of the folders to your user (so you can edit them)
  2. add a new file src/help.js and import the index.js or a specific module
const abc = require("./index");
//OR
import xyz from "./index";
  1. Notice that in the IDE the types of the properties of main module * @property {module:ApiClient} are not recognize as valid types.

Note: the same issue exists even if I install the package according to the instructions for local development (with npm link).

Is there any custom setting I can apply to the project so it can recognize the modules? Thanks.

Assignee
Assign to
Time tracking