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

Typescript error when postData is missing #325

Open
72L opened this issue Jul 21, 2023 · 2 comments
Open

Typescript error when postData is missing #325

72L opened this issue Jul 21, 2023 · 2 comments

Comments

@72L
Copy link

72L commented Jul 21, 2023

From the example:

const snippet = new HTTPSnippet({
        method: 'GET',
        url: 'http://mockbin.com/request',
      });

      const options = { indent: '\t' };
      const output = snippet.convert('shell', 'curl', options);
      console.log(output);

I get a typescript error

Argument of type '{ method: string; url: string; }' is not assignable to parameter of type 'HarRequest | HarEntry'.
  Type '{ method: string; url: string; }' is not assignable to type 'HarRequest'.
    Property 'postData' is missing in type '{ method: string; url: string; }' but required in type '{ postData: any; }'.ts(2345)
httpsnippet.d.ts(19, 5): 'postData' is declared here.
@AnWeber
Copy link

AnWeber commented Jul 24, 2023

With the new types, there are actually more problems that are not nice to use.

@AdrianMachado
Copy link

Yeah I just tried the new version and its borderline unusable. The types are broken and I get AJV errors whenever I try very simple requests

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

No branches or pull requests

3 participants