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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an error where conversion failed if securitySchemes are not defined #75

Merged
merged 2 commits into from
Apr 14, 2023

Conversation

dhwaneetbhatt
Copy link
Contributor

@dhwaneetbhatt dhwaneetbhatt commented Apr 13, 2023

Overview

This PR fixes an issue when RAML contains securitySchemes that could not be resolved.

RCA

When the spec did not have any securitySchemes but an existing resource references it via the securedBy parameter, it was throwing a referencing error as it was trying to do securitySchemes[securedBy].description, but since securitySchemes was an empty string, securitySchemes[securedBy] was undefined, leading to this error. This used to happen when creating auth object for the collection request.

Fix

  • Only resolve auth object for collection when both securedBy and securitySchemes are not empty
  • Even if both are non-empty, verify the existence of the description key via a safe check

Additional change - Test action runs only once for a PR. It runs on push only for the master and develop branches.

@dhwaneetbhatt dhwaneetbhatt self-assigned this Apr 13, 2023
lib/helper.js Outdated Show resolved Hide resolved
@dhwaneetbhatt dhwaneetbhatt merged commit 2702ec7 into develop Apr 14, 2023
@dhwaneetbhatt dhwaneetbhatt deleted the bug/fix-unresolved-securityschemes branch April 14, 2023 05:30
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.

2 participants