openapi-ts icon indicating copy to clipboard operation
openapi-ts copied to clipboard

Standalone package for your client

Open shriekdj opened this issue 9 months ago • 1 comments

Description

When We Generate Client For Our OpenAPI.json, It Can Also Create an Standalone Package with Script Like this openapi --input http://127.0.0.1:8000/openapi.json --output ./src/client2 --client fetch --name Backend --useOptions.

Which can be used like this

import { Backend } from '@/client';
export default const appClient = new Backend({
  BASE: 'http://localhost:8000',
});

Now I Can Use this single appClient Anywhere i want. and all functions are in this single object as method of that object.

Please Allow Option name instead of deprecating name in @hey-api/openapi-ts

shriekdj avatar May 18 '24 12:05 shriekdj