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

update httpsnippet to v3.0.1 to allow node v20 #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

noghartt
Copy link

@noghartt noghartt commented Jan 16, 2024

related to this issue #99

@MaximeCheramy
Copy link

I'm surprised that this would work. I use this patch on one of my projects:

diff --git a/node_modules/openapi-snippet/index.js b/node_modules/openapi-snippet/index.js
index ea07bdf..b71ab0b 100644
--- a/node_modules/openapi-snippet/index.js
+++ b/node_modules/openapi-snippet/index.js
@@ -9,7 +9,7 @@
 'use strict';

 const OpenAPIToHar = require('./openapi-to-har.js');
-const HTTPSnippet = require('httpsnippet');
+const { HTTPSnippet, availableTargets } = require('httpsnippet');

 /**
  * Return snippets for endpoint identified using path and method in the given
@@ -147,7 +147,7 @@ const formatTarget = function (targetStr) {
   const title = capitalizeFirstLetter(language);
   let library = targetStr.split('_')[1];

-  const validTargets = HTTPSnippet.availableTargets();
+  const validTargets = availableTargets();
   let validLanguage = false;
   let validLibrary = false;
   for (let i in validTargets) {

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.

3 participants