I’m wondering why have you decided to write a custom api client generator (genWeb3API.js) instead of using swagger’s or openapi’s own codegen?
If you for example write a code that uses the REST API directly, which is easy using the openapi codegen where you can get code for using the API in 100 languages, you cannot reuse this code in clients because the endpoints are completely different. At the same time, each time you create a Moralis SDK for another language you will need to port genWeb3API.js instead of just generating the code with openapi-codegen.
Wouldn’t it be better for at least having a similar endpoint structure, so that you only need to change the BASE_URL?
For example if I fetch the REST API directly a URL looks like this:
'https://deep-index.moralis.io/api/v2/address/nft?chain=eth&format=decimal'
so the generated code by the openapi-codegen will construct the address in that way when calling the generated function getNFTs() as per API definition.
But the endpoints of the own moralis server should look something like this
“myserver/functions/getNFTs/…”
so you cannot use the generated code by the openapi generator. Why don’t better use a URL format like this?:
“myserver/address/nft?chain=eth&format=decimal”
in that way you could easily reuse code and also save time if you port the SDK Moralis someday.