-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
The generator prefixes the basePath variable in class ApiClient with "http://localhost" when servers[0].url == '/api-xyz'
resulting in a basePath == 'http://localhost/api-xyz'
The expected basePath is '/api-xyz'
openapi-generator version
7.2.0
OpenAPI declaration file content or url
openapi: "3.0.3"
info:
title: "test api"
version: v1
servers:
- url: "/api-xyz"
paths:
"/account/v1/json/login":
post:
responses:
'201':
description: Created
requestBody:
description: ""
content:
"application/json":
schema:
type: object
properties:
emailAddress:
type: string
password:
type: stringRelated issues/PRs
Suggest a fix
The regex used in
Line 238 in e69fb86
| return Pattern.matches("^(\\/[\\w\\d]+)+", firstServer.getUrl()); |
Suggestion: ^(\/[\w\d_-]+)+
(will allow "-" and "_" in relative paths)
Reactions are currently unavailable