orval: Bug: multiple exports with the same name

I my *.yaml file I have a structure like this:

openapi 3.0.3
info: ...
tags: ...
paths: ...
components:
  schemas: 
    MyAnotherType:
      type: object
      description: Some text
      properties:
        details:
          type: array
          description: Some text
          items:
            $ref: '#/components/schemas/MyType'
    MyType:
      type: string
      description: Some text
      example: Some more text

this causes duplicated export type MyType = string in generated *.schema.ts file

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 17 (15 by maintainers)

Most upvoted comments

Yeah. Sorry for the incorrect issue description. I’ve figured out that problem can be reproduced this way:

  1. Create 1.yaml file with the some structure
  2. Duplicate this file with another name, lets say 2.yaml
  3. Go to the 1.yaml and add some property reference to the type from 2.yaml ($ref: './2.yaml#/components/schemas/MyType')

As a result all the referenced schemas will be merged and if there are any schemas with the same name the issue will be produced.