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

Remove trailing slashes from paths and header parameter improvements #196

Merged
merged 5 commits into from
Apr 4, 2019

Conversation

kanadgupta
Copy link
Member

@kanadgupta kanadgupta commented Apr 2, 2019

Adds the following (with corresponding tests):

  • Removes trailing slashes from the paths when operations are created
  • Overrides Accept header types found in response definitions if an Accept header is sent in the form data
  • Added a $ref lookup to path operation parameters

Asana tasks:

@kanadgupta kanadgupta requested a review from domharrington April 2, 2019 17:22
@@ -5,7 +5,8 @@ class Operation {
constructor(oas, path, method, operation) {
Object.assign(this, operation);
this.oas = oas;
this.path = path;
// strips trailing slash
this.path = path.endsWith('/') ? path.slice(0, -1) : path;
Copy link
Member

Choose a reason for hiding this comment

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

Yo! String.prototype.endsWith isn't supported in ie11. Can you check to see if this works in ie11? I can give you access to our browserstack account. I'm hoping that we've got @babel/env setup correctly here:

api-explorer/.babelrc

Lines 3 to 7 in 7963c65

["@babel/env", {
"targets": {
"browsers": ["last 2 versions"]
}
}],
but it's possible that we need to add an exclusion to allow ie11.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd be happy to test it in IE11 or just refactor this to something more universally compatible too. What would you prefer?

@kanadgupta kanadgupta merged commit 43afbc3 into master Apr 4, 2019
kanadgupta added a commit that referenced this pull request May 13, 2019
... and revert part of #196 where trailing slashes are stripped from the path URL.
kanadgupta added a commit that referenced this pull request May 22, 2019
…URL (#214)

* Create unique key for path URL and revert part of #196 where trailing slashes are stripped from the path URL.
@erunion erunion deleted the fix/header-parameters-not-updating 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants