Skip to content

Generated TS definitions don't contain any path/query parameters. #1983

Closed
@Rattlyy

Description

@Rattlyy

Description

The generated TS definitions don't contain any path/query parameters.

export interface operations {
    "TripRoutes.flights": {
        parameters: {
            query?: never;
            header?: never;
            path?: never;
            cookie?: never;
        };
        requestBody?: never;
        responses: {
/** removed **/
        };
    };
}

OpenAPI Schema:

{
  "openapi": "3.1.0",
  "servers": [
    {
      "url": "http://localhost:8080/api"
    }
  ],
  "tags": [
    {
      "name": "TripRoutes"
    },
  ],
  "paths": {
    "/flights": {
      "get": {
        "operationId": "TripRoutes.flights",
        "tags": [
          "TripRoutes"
        ],
        "parameters": [
          {
            "name": "sourceAirports",
            "required": true,
            "in": "QUERY",
            "schema": {
              "type": "object",
              "properties": {
                "additionals": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "code": {
                  "type": "string"
                },
                "id": {
                  "type": "integer",
                  "format": "int32"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "name"
              ]
            }
          },
          {
            "name": "destinationAirports",
            "required": true,
            "in": "QUERY",
            "schema": {
              "type": "object",
              "properties": {
                "additionals": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "code": {
                  "type": "string"
                },
                "id": {
                  "type": "integer",
                  "format": "int32"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "name"
              ]
            }
          },
          {
            "name": "adults",
            "required": true,
            "in": "QUERY",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "children",
            "required": true,
            "in": "QUERY",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "infants",
            "required": true,
            "in": "QUERY",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "startDate",
            "required": true,
            "in": "QUERY",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "required": true,
            "in": "QUERY",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direct",
            "required": false,
            "in": "QUERY",
            "schema": {
              "type": "boolean"
            }
          }
        ]
      }
    }
  }
}

Reproduction

Just download latest lib, plug my schema and run the command.

Checklist

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopenapi-tsRelevant to the openapi-typescript library

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions