otter icon indicating copy to clipboard operation
otter copied to clipboard

[Bug]: Multi tagged APIs not supported

Open kpanot opened this issue 1 year ago • 1 comments

Package name

generator-sdk

Package version

9..

Reproduction steps

API to use:

openapi: "3.0.0"
info:
  version: 1.0.0
  title: Swagger Petstore
  license:
    name: MIT
servers:
  - url: http://petstore.swagger.io/v1
paths:
  /pets:
    get:
      summary: List all pets
      operationId: listPets
      tags:
        - pets
        - other
      parameters:
        - name: limit
          in: query
          description: How many items to return at one time (max 100)
          required: false
          schema:
            type: integer
            maximum: 100
            format: int32
      responses:
        '200':
          description: A paged array of pets
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:    
              schema:
                $ref: "#/components/schemas/Pets"
 components:
  schemas:
    Pet:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        tag:
          type: string
    Pets:
      type: array
      maxItems: 100
      items:
        $ref: "#/components/schemas/Pet"
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string

Current result

Build failure because of double export of listPetsRequestData from other.ts and pets.ts

Expected result

  • Best solution: Export once the interface used in both Apis
  • possible solution: Export both interface with different name

Additional comments

The error has been reported for RequestData interface only but may be also on the Apis exported functions as well.

kpanot avatar Oct 03 '23 15:10 kpanot

Due to breaking change in the interface removal, the fix will be completely effective in v11

kpanot avatar May 16 '24 14:05 kpanot