Skip to content

Typescript error when postData is missing #325

Open

Description

@72L

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.

Activity

  1. AnWeber commented on Jul 24, 2023

    @AnWeber

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

  2. AdrianMachado commented on Aug 15, 2023

    @AdrianMachado

    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

  3. florianmartens commented on Sep 4, 2025

    @florianmartens

    Running into the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions