Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove duplicated slash if hideHostname option enabled #1448

Merged
merged 2 commits into from
Nov 3, 2020

Conversation

stasiukanya
Copy link
Contributor

@stasiukanya stasiukanya commented Nov 3, 2020

Fixes #1428

@@ -67,14 +67,15 @@ export class Endpoint extends React.Component<EndpointProps, EndpointState> {
const normalizedUrl = options.expandDefaultServerVariables
? expandDefaultServerVariables(server.url, server.variables)
: server.url;
const basePath = getBasePath(normalizedUrl) === '/' ? '' : getBasePath(normalizedUrl);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const basePath = getBasePath(normalizedUrl) === '/' ? '' : getBasePath(normalizedUrl);
const basePath = getBasePath(normalizedUrl);

return (
<ServerItem key={normalizedUrl}>
<Markdown source={server.description || ''} compact={true} />
<SelectOnClick>
<ServerUrl>
<span>
{hideHostname || options.hideHostname
? getBasePath(normalizedUrl)
? basePath
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
? basePath
? (basePath === '/' ? '' : basePath)

@RomanHotsiy RomanHotsiy merged commit 4729fc3 into master Nov 3, 2020
@andriyl andriyl deleted the fix/hide-hostname-option branch April 8, 2021 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hide-hostname option adds a slash - openapi 3.0
2 participants