Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSW: Incorrect import path of schema when set schemas and indexFiles is false #1547

Closed
tatsuya-asami opened this issue Jul 29, 2024 · 0 comments · Fixed by #1758
Closed

MSW: Incorrect import path of schema when set schemas and indexFiles is false #1547

tatsuya-asami opened this issue Jul 29, 2024 · 0 comments · Fixed by #1758
Labels
mock Related to mock generation msw MSW related issues
Milestone

Comments

@tatsuya-asami
Copy link

What are the steps to reproduce this issue?

  1. Set indexFiles:false and schemas in the output configuration.
  2. Set mock:true in the output configuration.
  3. Execute npx orval

What happens?

Generated .msw.ts files import schemas from index of schemas directory.
Below example, it should import schemas from '../../schemas/addressGroups'

// orval.config.js

export default {
  output:{
    indexFiles: false,
    mode: 'tags-split',
    target: 'src/api/clients',
    schemas: 'src/api/schemas',
    ...
  },
  ...
}

Generated .msw.ts

/**
 * Generated by orval v6.31.0 🍺
 * Do not edit manually.
 * Closed API Server
 * The Closed API description
 * OpenAPI spec version: 1.0
 */
import { HttpResponse, http } from 'msw'
import type { AddressGroups, List } from '../../schemas' // this path is wrong

What versions are you using?

Operating System: Mac OS 14.5(23F79)
Package Version: 6.31.0
Browser Version: chrome 126.0.6478.183(Official Build) (arm64)

@melloware melloware added msw MSW related issues mock Related to mock generation labels Jul 29, 2024
@melloware melloware changed the title Incorrect import path of schema of msw when set schemas and indexFiles is false MSW: Incorrect import path of schema when set schemas and indexFiles is false Jul 29, 2024
AlmarAubel added a commit to AlmarAubel/orval that referenced this issue Dec 20, 2024
@melloware melloware added this to the 7.3.1 milestone Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mock Related to mock generation msw MSW related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants