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

External file $refs not supported by jump to definition #13

Closed
dodongo opened this issue Aug 24, 2019 · 4 comments
Closed

External file $refs not supported by jump to definition #13

dodongo opened this issue Aug 24, 2019 · 4 comments

Comments

@dodongo
Copy link

dodongo commented Aug 24, 2019

A ref like the following doesn't support jump to definition, though it seems like it should be supported by the spec:

"schema": {
  "$ref": "./common_schemas.json#/CustomType"
}

where common_schemas.json is in the same directory and contains:

{
  "CustomType": {
    "description": "A custom type.",
    "type": "string"
  }
}
@dodongo dodongo changed the title External file $refs not followed by jump to definition External file $refs not supported by jump to definition Aug 24, 2019
@ak1394
Copy link
Collaborator

ak1394 commented Aug 24, 2019

You are correct, current implementation does not support opening external files. I'll look into supporting this in the next release.

@dodongo
Copy link
Author

dodongo commented Aug 24, 2019

@ak1394 One other note. Not sure if this would end up getting covered by the same fix, but in terms of getting the overview OpenAPI pane reflecting all the currently used data types - i.e:

Screen Shot 2019-08-24 at 1 12 58 PM

to reflect components that are in external refs, would the standard practice be to have the component still be listed in a specific openapi.json spec under internal components, and then referenced externally? i.e.:

"components": {
    "parameters": {
      "CustomParameter": {
        "$ref": "./common_parameters.json#/CustomParameter"
      },
...

Otherwise if using external refs inline like:

"paths": {
    "/some/path": {
      "post": {
        "operationId": "some_path_post",
        "summary": "Some Path Post",
        "description": "Some Path Post Description.",
        "parameters": [
          {
            "$ref": "./common_parameters.json#/CustomParameter"
          },
...

I would image the tooling would have no other way of actually displaying what components are being used on the overview pane. Unless there's plans for a separate section for external types?

@ak1394
Copy link
Collaborator

ak1394 commented Aug 24, 2019

Indeed. For the time being the outline is pretty simple and it pretty much follows the structure of the OpenAPI file itself. Operations for example don't list their parameters in the outline at all and components/parameters simply display parameter names without making distinction between inline/external definitions. This is something for us to figure out for the future versions.

@ak1394
Copy link
Collaborator

ak1394 commented Aug 26, 2019

The $refs issue has been fixed in the new v1.8.10. I'm going to close this issue, but feel free to comment (or open new issue) if you have further thoughts on displaying of types in the outline.

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

2 participants