Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Do not strip trailing slashes and instead create unique key for path URL #214

Merged
merged 3 commits into from
May 22, 2019

Conversation

kanadgupta
Copy link
Member

In #196, we stripped trailing slashes from path URLs, primarily because it would throw a React key uniqueness error.

Screenshot 2019-03-29 12 27 03

Instead of simply using the value of each part to designate the key, this PR will instead create a separate key for each part of the path URL that appends a value count. For example, if there are two values of /, they will have respective key values of /-0 and /-1.

... and revert part of #196 where trailing slashes are stripped from the path URL.
packages/api-explorer/src/PathUrl.jsx Outdated Show resolved Hide resolved
packages/api-explorer/src/PathUrl.jsx Outdated Show resolved Hide resolved
packages/api-explorer/src/lib/Oas.js Show resolved Hide resolved
Copy link
Member

@domharrington domharrington left a comment

Choose a reason for hiding this comment

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

LGTM!

@kanadgupta kanadgupta merged commit 5d7d1da into master May 22, 2019
@erunion erunion deleted the fix/trailing-slash-path-key branch July 1, 2019 16:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants