OpenAPITools / OpenAPITools/openapi-generator

How to use typescript-axios in een quasar (vue) projects

Open
#5,910 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Client: TypeScript
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Hi,

I have added this script to my package.json of my quasar project.
"api-script": "openapi-generator generate -i api.json -g typescript-axios -o src/components/openapi"

To use it I have tried to import it in my vue template like this:
import Api from 'components/openapi/index.ts'

building the project results in a error:
`
These relative modules were not found:

  • ./api in ./src/components/openapi/index.ts
  • ./configuration in ./src/components/openapi/index.ts
    `
    Any idea's how I should use it in a quasar/vue cli project?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the package.json script, api.json, and the generated src/components/openapi/index.ts in the Quasar/Vue project. Run the openapi-generator command and the project build to reproduce the missing ./api and ./configuration imports. Done means the generated TypeScript Axios client can be imported and the project builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.