endpoint.js icon indicating copy to clipboard operation
endpoint.js copied to clipboard

TypeScript: if endpoint for passed route has required parameters, require a parameters object to be set

Open gr2m opened this issue 5 years ago • 0 comments

Today, TypeScript does not complain about this

endpoint("GET /orgs/:org");

But it should, because the org parameter is required. If "GET /orgs/:org" is set, then TypeScript should complain that only one of two parameters is set and only chill once the code is

endpoint("GET /orgs/:org", {
  org: 'my-org'
});

I'll get to this myself eventually, but if anyone wants to give that a go, just comment and give it a go :)

gr2m avatar Apr 20 '20 22:04 gr2m