- Added escape of path

This commit is contained in:
Ferdi Koomen 2019-12-24 10:48:43 +01:00
parent 0d4c339a5c
commit 6681f270b6
2 changed files with 4 additions and 3 deletions

View File

@ -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",

View File

@ -18,8 +18,9 @@ import { Result } from './Result';
*/
export async function request(options: Readonly<RequestOptions>): Promise<Result> {
// 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({