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

Allow go to definition to work for paths (trpc style)

Open tonyxiao opened this issue 2 years ago • 2 comments

Description

When calling APIs it is frequently extremely useful to be able to see its definition in the typing file, what are the params, body, etc.

Today navigating from call site to where the paths is defined is not easy.

client.POST('/chat.postMessage')

it would be great if I can right click on /chat.postMessage and select go to definition in vscode and be taken to where it is defined.

Proposal

TRPC uses a proxy approach to enable any property access at run time.

Checklist

tonyxiao avatar Nov 27 '23 05:11 tonyxiao

This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

github-actions[bot] avatar Aug 06 '24 12:08 github-actions[bot]

A related idea is to use client['/chat/message'].POST(). Could be easier for intellisense

tonyxiao avatar Aug 07 '24 00:08 tonyxiao