Are URL parameters supported? #578
-
| I have an API with specifications like the following: /app/{model-id1}/{model-id2}/compare Within the generated SDK it doesn't look like any URLs that have parameters like this are given function stubs to call. Is this a supported feature? Where would these functions be/how would I use them? If not, is there another tool that I could use to generate API calls, or would I have to build them manually? | 
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
| URL parameters definitely are supported! If something is not being generated it is probably either a bug in the generator or some unsupported feature. Here's a spec I wrote to test this out just now: {
  "openapi": "3.0.2",
  "info": {
    "title": "My Test API",
    "version": "0.1.0"
  },
  "paths": {
    "/app/{model-id1}/{model-id2}/compare": {
      "get": {
        "parameters": [
          {
            "name": "model-id1",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "model-id2",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    }
  }
}Which produced a file  async def asyncio_detailed(
    *,
    client: Client,
    model_id1: str,
    model_id2: str,
) -> Response[Any]:
    ... | 
Beta Was this translation helpful? Give feedback.
Hyphens are now supported in 0.19.0 🥳