Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmd+Click to navigate to source code method mentioned in operationId #277

Open
kavishdahekar-sap opened this issue Jul 25, 2024 · 4 comments

Comments

@kavishdahekar-sap
Copy link

Usually OpenAPI spec and source code is maintained in the same repository.
It would be a great feature to be able to Cmd+Click the operationId of an API endpoint and have VSCode navigate to that method.

I am willing to take this up if you think this is a worthwhile feature.

@kavishdahekar-sap kavishdahekar-sap changed the title Cmd+Click to navigate to source code method mentioned inoperationId Cmd+Click to navigate to source code method mentioned in operationId Jul 25, 2024
@ak1394
Copy link
Collaborator

ak1394 commented Jul 29, 2024

Hi @kavishdahekar-sap This is sounds like an interesting feature to have! It would be pretty challenging to try to locate matching code, given that implementation could be in any language and framework? How do you plan to tackle this problem?

@kavishdahekar
Copy link

I was actually just thinking about Python+Connexion where Connexion implicitly links the endpoint to the operation via Flask under the hood. The operationId can be exactly matched to the packages down to the method name.

Since OpenAPI just enforces the operationId to be a unique string and it doesn't necessarily have to be associated with its implementation code, we could probably just start with Python+Connexion for now and either disable the feature for other cases or just trigger a search for all references of the operationId in the workspace on Cmd+Click.

@ak1394
Copy link
Collaborator

ak1394 commented Aug 6, 2024

This seems pretty limited solution, IMO...

@kavishdahekar
Copy link

That's a fair conclusion, however, it's often not feasible to support all languages for a new feature right from the start. By starting with Python, we can implement and refine the feature, setting a foundation for further development. This will also allow us to gather feedback and make iterative improvements. Ideally, as the feature proves its value and stability, other contributors from the community can help extend its support to additional languages over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants