Skip to content

Problem generating library with multiple path parameters #9

@dgarciabriseno

Description

@dgarciabriseno

When generating a client library, I get this following function:

export function getBodyPosition(params) {
  return request("get", `/ephemeris/${params.path.provider}/{body}`, { "header": { "Content-Type": "application/json", }, })(params);
}

It expect it to be

export function getBodyPosition(params) {
  return request("get", `/ephemeris/${params.path.provider}/${params.path.body}`, { "header": { "Content-Type": "application/json", }, })(params);
}

The relevant section of the openapi json I'm using:

"/ephemeris/{provider}/{body}": {
      "get": {
        "operationId": "GetBodyPosition",
        "parameters": [
          {
            "description": "One of the ephemeris providers. ['horizons']",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "description": "One of the ephemeris providers. ['horizons']",
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "description": "Observatory/Celestial body of interest.",
            "in": "path",
            "name": "body",
            "required": true,
            "schema": {
              "description": "Observatory/Celestial body of interest.",
              "title": "Body",
              "type": "string"
            }
          },
          {
            "description": "List of dates to return coordinates for.",
            "in": "query",
            "name": "dates",
            "required": true,
            "schema": {
              "description": "List of dates to return coordinates for.",
              "items": {
                "format": "date-time",
                "type": "string"
              },
              "minItems": 1,
              "title": "Dates",
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EphemerisResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeliosExceptionResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ValidationErrorModel"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        },
        "summary": "Get general coordinates",
        "tags": [
          "Ephemeris"
        ]
      }
    },

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