openapistack / openapi-client-axios

JavaScript client library for consuming OpenAPI-enabled APIs with axios
https://openapistack.co
MIT License
556 stars 67 forks source link

How does it work? #149

Closed kayode-adechinan closed 1 year ago

kayode-adechinan commented 1 year ago

First, thanks for the library.

I am using the following snippet with typescript:

import OpenAPIClientAxios from "openapi-client-axios";

export const demo = async () => {

  const api = new OpenAPIClientAxios({
    definition: "http://localhost:8080/openapi-specs.json",
    });

  api.init();

  const client = await api.getClient();

  await client....
};

And i am not getting any autocompletion...

Am i missing something ?

anttiviljami commented 1 year ago

See https://github.com/anttiviljami/openapi-client-axios/blob/master/packages/openapi-client-axios/README.md#generating-type-files-dts