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

fix(msw): fixed imports of split-tags, tags, and split mode #1205

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

soartec-lab
Copy link
Member

@soartec-lab soartec-lab commented Feb 6, 2024

Status

READY

Description

fix #1204
Fix #1201

I wanted to import types same to custom hooks in mocks in #1171, so I made changes to the import handling. However, this contained some issues, so I fixed them.

split, split-tags

For example, imports used only in mocks such as enum types were lost, so we included them in the import target.

tags

Similarly, imports used only in mocks such as enum types were lost, so we included them in the import target.
In addition, in tags mode, custom hooks and mocks are stored in the same file, so the import used by custom hooks was being imported twice, so this has been fixed.

Related PRs

this bug made by #1171

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

  1. Prepare definition including enum
openapi: 3.1.0
info:
  title: Missing import
paths:
  /dog:
    get:
      responses:
        200:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dog'
components:
  schemas:
    Dog:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/DogType'
    DogType:
      type: string
      enum:
        - Labradoodle
        - Dachshund
  1. Run split-tags, tags, and split mode respectively
  2. Check that DocType import is included
import {
  DogType
} from '../model'

@soartec-lab soartec-lab added the bug Something isn't working label Feb 6, 2024
@soartec-lab soartec-lab added this to the 6.25.0 milestone Feb 6, 2024
@soartec-lab soartec-lab marked this pull request as ready for review February 6, 2024 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants