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.
Adding the exposing of curlify
Description
By adding a base plugin, we can expose curlify. Additionally I added a wrapper around the swagger js client buildRequest function to making calling it a little saner.
Motivation and Context
In our project we're looking to include curl based examples, but not necessarily within the context of swagger-ui, and we typically have left the "Try it out" feature disabled. Rather than reinventing the wheel of writing a swagger -> curl converter, it feels like it could be exposed here.
Additionally it looks like
asCurl
used to be a function of the swagger-js library but was removed / moved to swagger-ui without a way of calling it besides in the UI itself. See this issue.How Has This Been Tested?
Within
npm run dev
:If unit testing is required around this, I'll be happy to write some, but want to check opinions before I go further
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests