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

feat: adding support for server variables into oas-to-har #1241

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

erunion
Copy link
Member

@erunion erunion commented Mar 29, 2021

🧰 What's being changed?

  • Adds support for servers and server variables to be set in oas-to-har.
  • Added some comprehensive usage docs to the oas-to-har README.

🧬 Testing

See supplied unit tests.

@erunion erunion added the type:enhancement A potential new feature to be added, or an improvement we could make label Mar 29, 2021
@erunion erunion temporarily deployed to explorer-pr-1241 March 29, 2021 23:01 Inactive
@erunion erunion requested review from Dashron and ilias-t March 29, 2021 23:01
};

// If the incoming `server.variables` is missing variables let's pad it out with defaults.
formData.server.variables = {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should we just move up into the object above or was this done to improve readability?

Copy link
Member Author

Choose a reason for hiding this comment

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

Since I'm loading values in as ...values above I don't have a clean way to re-fill server.variables with defaults if they're missing in the block above this.

- `cookie`
- `formData`
- `header`
- `server` — If the supplied OAS has multiple severs or server variables you can use this to set which server and variables to use. Shape of it should be: `{ selected: Integer, variables: { ...key-values }}`. `selected` should coorespond to index of the `servers` array in your OAS.
Copy link
Contributor

Choose a reason for hiding this comment

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

mdash 👏

@erunion erunion merged commit abe0486 into next Mar 30, 2021
@erunion erunion deleted the feat/support-server-variables branch March 30, 2021 17:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:enhancement A potential new feature to be added, or an improvement we could make
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants