mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
- Added escape of path
This commit is contained in:
parent
0d4c339a5c
commit
6681f270b6
@ -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",
|
||||
|
||||
@ -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({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user