Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

feat: rewriting the library in typescript and upgrading oas #19

Merged
merged 3 commits into from
Nov 7, 2021

Conversation

erunion
Copy link
Member

@erunion erunion commented Nov 5, 2021

🧰 What's being changed?

🧬 Testing

All tests still pass?

@erunion erunion added enhancement New feature or request refactor Issues about tackling technical debt labels Nov 5, 2021
@erunion erunion requested review from domharrington, a team, Dashron and julshotal and removed request for a team November 5, 2021 21:50
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;
};
Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -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 });
Copy link
Member Author

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.

*/
export function getExtension(extension: keyof Extensions, oas: Oas, operation?: Operation) {
if (operation) {
if (operation.hasExtension('x-readme')) {
Copy link
Member Author

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.

@erunion erunion merged commit ff2c803 into main Nov 7, 2021
@erunion erunion deleted the feat/typescript branch November 7, 2021 04:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request refactor Issues about tackling technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant