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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make modifySpec async #6655

Merged
merged 1 commit into from Oct 27, 2020
Merged

feat: make modifySpec async #6655

merged 1 commit into from Oct 27, 2020

Conversation

jannyHou
Copy link
Contributor

@jannyHou jannyHou commented Oct 26, 2020

Signed-off-by: jannyHou juehou@ca.ibm.com

Change modifySpec to be an async function to allow async spec updates.

Checklist

  • DCO (Developer Certificate of Origin) signed in all commits
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

馃憠 Check out how to submit a PR 馃憟

@@ -13,7 +13,7 @@ import {OASEnhancerBindings} from './keys';
*/
export interface OASEnhancer {
name: string;
modifySpec(spec: OpenApiSpec): OpenApiSpec;
modifySpec(spec: OpenApiSpec): Promise<OpenApiSpec>;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it can be made backward compatible as follows:

modifySpec(spec: OpenApiSpec): ValueOrPromise<OpenApiSpec>;

Existing enhancers can stay as-is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice! It avoids the breaking change.

Signed-off-by: jannyHou <juehou@ca.ibm.com>
@jannyHou jannyHou merged commit fcd0bcb into master Oct 27, 2020
2 checks passed
@jannyHou jannyHou deleted the modify-spec-async branch October 27, 2020 13:45
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.

None yet

2 participants