diff --git a/package.json b/package.json index 11e5e88e..874b6618 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openapi-typescript-codegen", - "version": "0.1.9", + "version": "0.1.10", "description": "NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification.", "author": "Ferdi Koomen", "homepage": "https://github.com/ferdikoomen/openapi-typescript-codegen", diff --git a/src/templates/core/request.ts b/src/templates/core/request.ts index 93927b07..00d504dc 100644 --- a/src/templates/core/request.ts +++ b/src/templates/core/request.ts @@ -18,8 +18,9 @@ import { Result } from './Result'; */ export async function request(options: Readonly): Promise { - // Create the request URL - let url = `${OpenAPI.BASE}${options.path}`; + // Escape path (RFC3986) and create the request URL + let path = options.path.replace(/[:]/g, '_'); + let url = `${OpenAPI.BASE}${path}`; // Create request headers const headers = new Headers({