This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: rewriting the library in typescript and upgrading oas
#19
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
erunion
added
enhancement
New feature or request
refactor
Issues about tackling technical debt
labels
Nov 5, 2021
erunion
requested review from
domharrington,
a team,
Dashron and
julshotal
and removed request for
a team
November 5, 2021 21:50
erunion
commented
Nov 5, 2021
Comment on lines
+15
to
+28
export type Extensions = { | ||
[CODE_SAMPLES]: { | ||
language: string; | ||
code: string; | ||
name?: string; | ||
}; | ||
[EXPLORER_ENABLED]: boolean; | ||
[HEADERS]: { [key: string]: string | number }[]; | ||
[PROXY_ENABLED]: boolean; | ||
[SAMPLES_ENABLED]: boolean; // @deprecated | ||
[SAMPLES_LANGUAGES]: string[]; | ||
[SEND_DEFAULTS]: boolean; // @deprecated | ||
[SIMPLE_MODE]: boolean; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
erunion
commented
Nov 5, 2021
@@ -40,13 +40,13 @@ describe('#getExtension', () => { | |||
}); | |||
|
|||
it('should locate an extensions listed at the root', () => { | |||
const oas = new Oas({ ...petstore, [`x-${extensions.EXPLORER_ENABLED}`]: false }); | |||
const oas = Oas.init({ ...petstore, [`x-${extensions.EXPLORER_ENABLED}`]: false }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This .init()
method is part of readmeio/oas#537.
erunion
commented
Nov 5, 2021
*/ | ||
export function getExtension(extension: keyof Extensions, oas: Oas, operation?: Operation) { | ||
if (operation) { | ||
if (operation.hasExtension('x-readme')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new hasExtension
and getExtension
accessors are part of readmeio/oas#537.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧰 What's being changed?
oas
to the latest release to include its Typescript rewrite and new accessors.Still waiting forgetExtension()
andhasExtension()
in feat: addition of aninit
and methods for pulling spec extensions oas#537 to be merged and published.oas
.🧬 Testing
All tests still pass?