You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create some code that will generate all the available operations based on the paths automatically, so you don't need to create another fetch.path("route").method("method").create() every time you add another path in your api spec.
Anyone who had any luck with this?
I tried something like the below and couldn't really think it to the end
import { ApiPaths, paths } from "./schema"
const fetch = Fetcher.for<paths>();
const createAll = () => {
const allPaths = Object.keys(ApiPaths);
const all = {};
for (const route of allPaths) {
all[route] = fetch.path(route).method("get").create();
}
return all;
};
The text was updated successfully, but these errors were encountered:
Hi!
I'm trying to create some code that will generate all the available operations based on the paths automatically, so you don't need to create another
fetch.path("route").method("method").create()
every time you add another path in your api spec.Anyone who had any luck with this?
I tried something like the below and couldn't really think it to the end
The text was updated successfully, but these errors were encountered: