Skip to content

Oats can't handle complex types as query parameters #18

@glinton

Description

@glinton

If using something as simple as an array, oats' generated code results in any.

For example, the following swagger generates this interface:

export interface GetStuffParams {
  query?: {
    stuffFilter?: string
    stuffFilterComplex?: any
  }
}
openapi: "3.0.0"
info:
  title: Stuff service
  version: 0.0.0
servers:
  - url: /api/v2
paths:
  /stuff:
    get:
      operationId: createStuff
      parameters:
        - $ref: "#/components/parameters/StuffFilter"
        - $ref: "#/components/parameters/StuffFilterComplex"
      responses:
        '204':
          $ref: "#/components/responses/NoContent"
components:
  parameters:
    StuffFilter:
      in: query
      name: stuffFilter
      required: false
      description: stuff to return
      schema:
        type: string
    StuffFilterComplex:
      in: query
      name: stuffFilterComplex
      required: false
      description: stuff to return
      schema:
        type: array
        items:
          type: string
  responses:
    NoContent:
      description: No content

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions