Coder Social home page Coder Social logo

redocly-vs-code's People

Contributors

dverbovyi avatar ivana-isadora avatar marshevskyy avatar roman-sainchuk avatar tatomyr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redocly-vs-code's Issues

Should not complain about missing server if you yaml contains only components

What happened?
I'm getting an error mark in an yaml containing only components

What should have happened instead?
The missing server rule must be applied only when paths (or webhook?) are present.

Also, I'm getting never used warnings for all schemas in this case.

Minimal reproducible OpenAPI snippet

openapi: 3.1.0
info: 
  title: Common Schemas
  version: "latest"

components: 
  schemas: 
    BusinessUnit:
      title: BusinessUnit
      type: object
      properties:
        id:
          type: integer
          format: int32
        description:
          type: string

If possible, include a short example of your OpenAPI definition that we can use to simulate the problem.

Screenshots
image

Additional context

Release 0.3.3 (2023-11-16)

entire yaml marked with problem "should have `security` defined"

What happened?

I've got a problem "Every API should have security defined on the root level or for each operation" after loading a typical example found on the web (e.g. petstore.yaml). So far so good, because the yaml in fact does have this exact characteristic.

But the attributes of such finding are broken:

  • it's a problem (not a warning) underlined in red in VS Code editor
  • the entire contents of the yaml file is underlined
    • The underline is visually very striking.
    • It's overshadowing any other problem or warning. To be able to observe any other problem/warning I need to add the security field to every single operation.

What should have happened instead?

  • I should see a warning (neither OAS3 or OAS3.1 strictly require security field) unerlined in yellow
  • Just a relevant part of the yaml file underlined (for example just an operation "get" or "post" alone?)
  • These operations that happen to have security field should not be underlined.

Minimal reproducible OpenAPI snippet

openapi: "3.0.0"
info:
paths:
  /pets:
    get:
      responses:
        "200":

Screenshots

Screenshot from 2022-10-25 17-35-17

Additional context

Happens on "3.0.0" and "3.1.0".
Today's version of the plugin from VS Code Marketplace: 2022-10-25.

Handle multi-root Workspaces

What should we improve?

Users can have several projects in vs code workspace . Each project can have its own configuration file. The goal is to find the correct configuration depending on the file selected by the user and highlight errors and warnings in OpenAPI definition files according to the configuration

How should we improve it?

The extension should select the root folder and look for the configuration file there depending on the file opened by the user

Why should we improve it?

Currently, the extension does not work correctly with Multi-root Workspaces

Describe alternatives you've considered

To do nothing

Additional context

Multi-root Workspaces

Use lint config from redocly.yaml apis section

What should we improve?

Since introducing changes to the redocly.yaml config structure we can apply different lint rules to different files. The goal is to highlight errors and warnings in OpenAPI definition files according to the lint rules defined for them. The open question remains which lint config to use for files that are used in different root files via $ref reference.

How should we improve it?

VS Code should indicate which apis alias the current file is referring to and apply the appropriate lint config. In case there's more than one alias using the same root file it should apply the first alias from the apis section.

Why should we improve it?

It would help users understand how the specific config applies to different API definitions.

Describe alternatives you've considered

None

Additional context

This change is related to the OpenAPI CLI core package and most of the code should be implemented there. However, most of the changes are VS Code extension specific and should be implemented from the perspective of VS Code.

Bug: header fields `name` and `in` not expected here - Parameter Object

What happened?

I have a large set of headers defined as components. It seems only some of the headers will produce an error for not expected here.
My JSON schema is valid and consistent with all other headers using a similar schema.

Minimal reproducible OpenAPI snippet

{
    "components": {
        "parameters": {
            "header_Content-Language": {
                "name": "Content-Language",
                "in": "header",
                "description": "Specifies the languages for which the entity-body is intended ",
                "required": false,
                "schema": {
                    "type": "string"
                }
            },
            "header_Location": {
                "name": "Location",
                "in": "header",
                "description": "Used to redirect the recipient to a location other the request URI for completion of the request or identification of a new resource",
                "required": false,
                "schema": {
                    "$ref": "../../../common/uriType_v01.json"
                }
            }
        }
    }
}

Screenshots
Example of the error produced
image

Example of a valid component schema
image

Additional Content
Version: 1.65.2 (user setup)
Commit: c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1
Date: 2022-03-10T14:33:55.248Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

Invalid cursor snippets for servers

What happened?

When you add to server item url it sets two snippets.

What should have happened instead?

Set only one snippet.

If possible, include a short example of your OpenAPI definition that we can use to simulate the problem.

Screen.Recording.2022-02-01.at.10.31.00.mov

Screenshots

Screenshot 2022-02-01 at 10 44 40

Changing custom plugin (rule) not reflected in lint

What happened?

I changed a custom rule. In VS Code with the extension v0.2.3 the problem error highlight still happens even though I changed the rule. I run openapi lint and confirm there are no errors. It feels like the custom plugin was cached somehow.

What should have happened instead?

The changed custom plugin should be evaluated.

A clear and concise description of the behavior you expected to happen.

Minimal reproducible OpenAPI snippet

Rebilly/api-definitions#725

Use reference docs from npm registry

What should we improve?
Use reference docs from npm registry instead of bundled local file.

A clear and concise description of desired behavior for the feature.
Dont keep bundled reference-docs package but get it by npm i.

Why should we improve it?
It will be easier to update version of reference-docs. Because currently every update of ref docs requires changes to it.

Configurable rule not reporting problems

What happened?

I added this configurable rule, as mentioned here: Redocly/redocly-cli#1225

  rule/restful-paths:
    subject: 
      type: Paths
    assertions: 
      notPattern: '/[^{/}]+/[^{/}]+/'
    message: Two consecutive path segments don't have a variable

It does not report a problem, when running lint reports 22 problems.

What should have happened instead?

I expect to see the 22 problems.

Minimal reproducible OpenAPI snippet

Contact me.

Screenshots
n/a

Additional context

OAS 3.1, Redocly CLI 1.0.2.

Missing space after colon with auto-complete

What happened?

I was writing properties.

type: object
properties:
  myPropName:
    type:

When I selected type I ended up with type: without a trailing space and yaml requires a space after a colon.

This is medium priority because of the frequency (this will happen to me about 100 times today).

This same issue happens with other selections too such as default: etc...

What should have happened instead?

The extension should have had a space. Also, when the space is there, there is a menu to autocomplete the type (e.g. string).

Minimal reproducible OpenAPI snippet

See above.

Screenshots

Short video snippet:

missing-space-vs-code.mp4

Additional context

v0.2.9

Highlighting error on OpenApi Version

What happened?
Error showing up with OpenAPI version
openapi: 3.0.1

String does not match the pattern of "^3\.1\.\d+(-.+)?$".yaml-schema: openapi.json
What should have happened instead?
Should accept the version of 3.0.1

Minimal reproducible OpenAPI snippet
openapi: 3.0.1

If possible, include a short example of your OpenAPI definition that we can use to simulate the problem.

Screenshots

If applicable, add screenshots to help explain your problem.
image

Additional context
Hi! Sorry aware this probably isnt a bug, but have trawled through docs and cant find where to set the OpenAPI version - really sorry if this is an obvious configuration error/ fix
Add any other information about the problem here, like: the extension version number; OpenAPI version you're using in your definition; your operating system.

Too much spaces in autocomplete

What happened?
When adding a new key to the operation autocompletes added too much spaces.

What should have happened instead?

Screen.Recording.2022-09-16.at.12.20.06.mov

Minimal reproducible OpenAPI snippet

  /user:
    post:
      tags:
        - user
      summary: Create user
      description: This can only be done by the logged in user.
      operationId: createUser
      responses:
        default:
          description: successful operation
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
        description: Created user object
        required: true

Support for http_proxy and https_proxy

What should we improve?

Make HTTP/HTTPS requests via http_proxy and https_proxy

How should we improve it?
Not known yet

Why should we improve it?

In my company, everything has to be through the IT proxy.
After entering my API key and click Submit, I can see the following error messages:

ar [FetchError]: request to https://api.redoc.ly/registry failed, reason: connect ETIMEDOUT 18.208.49.27:443
    at ClientRequest.<anonymous> (/data/home/jizu/.vscode-server/extensions/redocly.openapi-vs-code-0.2.3/out/server/src/server.js:60:306517)
    at ClientRequest.emit (events.js:327:22)
    at ClientRequest.EventEmitter.emit (domain.js:467:12)
    at TLSSocket.socketErrorListener (_http_client.js:469:9)
    at TLSSocket.emit (events.js:315:20)
    at TLSSocket.EventEmitter.emit (domain.js:467:12)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT'
}

Describe alternatives you've considered

Additional context

Cannot render docs offline

What happened?

When I have no internet connection, my docs preview in VSCode doesn't work. It tells me to enter a login token.

What should have happened instead?

I expected to have a preview of my docs, like I do using redocly preview-docs

Wrong `theme.openapi` autocompletion in *redocly.yaml*

What happened?
When trying to autocomplete theme.openapi in the redocly.yaml file, it get's appended with the 3.1.0 string despite it should be an object.

What should have happened instead?

The extension should not populate theme.openapi with a string.

Screenshots

Screen.Recording.2023-03-10.at.11.51.50.mov

Preview window gets blank while using it with multiple files

The customer reported the following:

Plugin opens several tabs and when I go between them, the pages turn white and I have to close and reopen the plugin:

image

The issues happens in MacOS.
When the user is opening the preview everting works fine, but if he is trying go to another file using ref+ cmd button, the preview turns to white.
For example, if there is a ref in the file and he is trying to use the command on the ref, the preview turns to white.

Minimal reproducible OpenAPI snippet
You can replicate this issue by splitting a sample petstore definition and further trying to navigate to any path using CMD + click
image

Front logo Front conversations

Error output is not formed correctly in Problems tab

What happened?

Recently, the VS Code output is not formatted correctly. I'm not sure exactly when it started, but it seems to have been from last week.. 03/10/23+

openapi: 3.0.3
info:
  title: blah
  version: 1.1.0
paths:
  /test/api:
    get:
      parameters: 
        - name: jeremy
          in: query
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "../../../common/shared/confirm-message-schema_v03.json"
    post:
      requestBody:
        $ref: "#/components/requestBodies/jeremy"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "schemas/test-schema_v01.json"
              examples: 
                example: 
                  externalValue: "./examples/example.json"
                example1:
                  $ref: "./not-schemas/test-schema_v01.json"
components:
  requestBodies:
    jeremy:
      required: true
      content:
        application/json:
          schema:
            $ref: "./common/shared/-schema_v01.json"
  schemas:
    jeremy:
      type: object
      properties:
        test:
          $ref: "jeremy-test"

Screenshots

two diff examples of output from different files.

image
image

Additional context

Last released
2023-9-20, 10:16:31
Last updated
2023-9-20, 20:18:54

synchronize VSC extension with openapi core package releases

It's my understanding the extension is using openapi core. VSC is reporting the extension was last updated on March 24, 2022 but there has been at least 5 newer releases on the openapi core package at time of writing. Is the VSC extension in sync with the other package? I've also noticed and created an issue on the redoc repo to synchronize the demo-bundle.js. @AlexVarchuk has been responding there.
Redocly/redoc#1896

Cursor context breaks on operation servers

What happened?

The cursor context breaks after I go to operation servers (as opposed to global root-level servers).

screenshot

What should have happened instead?

It should show servers cursor context similar to as in the document root.

A clear and concise description of the behavior you expected to happen.

Minimal reproducible OpenAPI snippet

  servers:
    - url: https://ec.europa.eu/commission/presscorner/api 
  summary: Get document by reference
  operationId: getDocument
  parameters:
    - name: reference
      in: query
      schema:
        type: string
        description: The topic reference
        example: IP/22/1649
    - name: language
      in: query
      schema:
        type: string
        maxLength: 2
        description: The language code
        example: en
    - name: ts
      in: query
      schema:
        type: integer
        description: The timestamp in milliseconds
        example: 1647099339234
  responses:
    200:
      content:
        application/json:
          schema:
            type: object
      description: OK

Additional context
0.2.6

Support config files located in nested directories

What should we improve?

Currently we only support redocly.yaml file located in the root folder as the Redocly config file for VS Code.
We want to allow using different config files (similarly as we do in Redocly CLI using --config option).

How should we improve it?

We could either:

  • Resolve workspace configs (depending on the monorepo structure)
  • Resolve current closest redocly.yaml file
  • Allow users to provide path to a specific config file (e.g. through a config dialog window)

Why should we improve it?

Users might use monorepo structure (or any other complex file structure).

Describe alternatives you've considered

Doing nothing. Users may move their redocly.yaml files to the root level (or use a symlink to the actual config file).

Cursor context has active button 'Go to root' in any yaml file

What happened?

  1. Go to yaml file but not definition
  2. Open Cursor Context
  3. You can see active button Go to root which display context from Open API.
Screen.Recording.2023-05-17.at.19.42.13.mov

What should have happened instead?

Go to root button should be disable or display context by file or add placeholder.

Previewing empty paths OAS v3.1.0

When trying to preview the documentation for an OpenAPI Document complying to the version 3.1.0 of the spec with empty paths, an error is shown.

Can you please check this? Thanks in advance.

How to reproduce

The OpenAPI Document I'm trying to render:

openapi: 3.1.0
info:
  title: Book Shelf API
  description: An API to keep track of Books
  version: "0.1"
  contact:
    name: API Designer
  license:
    url: https://opensource.org/licenses/MIT
    name: MIT
servers:
  - url: http://api.bookshelf.com
paths: {}

Expected Behavior

The API metadata is rendered.

Actual Behavior

This error is show:

Something went wrong...
Cannot read properties of undefined (reading 'type')
Stack trace
(...)

More context

According to the spec, a document with an empty paths is a valid one:

The Paths MAY be empty, due to Access Control List (ACL) constraints.

(source: https://spec.openapis.org/oas/v3.1.0#paths-object)

Leaving the paths empty can be useful for API Designers that want to describe only the contact information or the API Security requirements.

The Redoc Interactive Demo seems to handle this correctly, rendering the API metadata.

`exclusiveMinimum`/`exclusiveMaximum` OAS v3 is not validated correctly

What happened?

When using exclusiveMinimum and exclusiveMaximum properties with OAS v3, the validator marks its usage as an error, saying its value should be a boolean. However, since OAS v3 this field now holds the actual (exclusive) minimum/maximum value, and is no longer a boolean.

What should have happened instead?

An integer or float should be accepted as the value for exclusiveMinimum/exclusiveMaximum. A boolean should no longer be accepted when using OAS v3.x.x.

Minimal reproducible OpenAPI snippet

openapi: 3.0.2
info: 
  title: title
  version: 1.0.0
  description: description
  license: 
    name: A license
    url: https://a.license.org
servers: 
  - url: https://a.server.org
paths: 
  /newPath:
    get: 
      operationId: newPathGet
      parameters:
        - in: query
          name: positiveValue
          required: true
          schema:
            type: number
            format: float
            exclusiveMinimum: 0.0
      summary: A test path.
      responses: 
        204:
          description: Successful
        422:
          description: Unprocessable

Screenshots

Screen Shot 2022-08-05 at 15 37 55

Additional context

Using OAS 3.0.2.

Extension ignores linting rules defined in oas2_0Rules, oas3_0Rules and oas3_1Rules fields in .redocly.yaml

What happened?

Looks like extension always uses only recommended rules

What should have happened instead?

Rules defined in oas3_0Rules should override recommended rules

Minimal reproducible OpenAPI snippet

apiDefinitions:
  main: ./openapi.yaml
lint:
  rules:
    info-description: warn
    info-contact: off
    info-license: off
    info-license-url: off
    tag-description: warn
    tags-alphabetical: off
    parameter-description: off
    no-path-trailing-slash: warn
    no-identical-paths: warn
    no-ambiguous-paths: warn
    path-declaration-must-exist: warn
    path-not-include-query: warn
    path-parameters-defined: warn
    operation-description: off
    operation-2xx-response: warn
    operation-4xx-response: off
    operation-operationId: warn
    operation-summary: error
    operation-operationId-unique: warn
    operation-parameters-unique: warn
    operation-tag-defined: off
    operation-security-defined: warn
    operation-operationId-url-safe: warn
    operation-singular-tag: off
    no-unresolved-refs: error
    no-enum-type-mismatch: warn
    boolean-parameter-prefixes: off
    paths-kebab-case: off
    no-invalid-schema-examples: off
    no-invalid-parameter-examples: off
    no-unused-components: warn
    spec: error
  oas3_0Rules: 
    no-invalid-media-type-examples: warn
  extends: []

Improve the default `redocly.yaml` file

What should we improve?

We offer a default Redocly configuration file when we detect an openapi definition.

How should we improve it?

  1. Rename it from .redocly.yaml to redocly.yaml.
  2. Replace the contents of the file with the one below, but be sure to change the path to the root file detected.
# See https://redocly.com/docs/cli/configuration/configuration-file/ for information on how to customize your configuration

apis:
  changeme@v1:
    root: ./openapi.yaml

lint:
  extends:
    - recommended
  rules:
    paths-kebab-case: error

features.openapi:
  generateCodeSamples:
    languages:
      - lang: curl
      - lang: Node.js
      - lang: Python

Why should we improve it?

The current one doesn't actually work and requires the user to make a lot of changes.

Describe alternatives you've considered

  • Removing the apis section.

Additional context

The current generated file:

apiDefinitions:
  # a set of named keys and values of entrypoints to OpenAPI definitions.
  # example
  # petstore: ./openapi.yaml

lint:
# the lint options

referenceDocs:
# the API reference docs options, including theme options.

Reference values aren't loaded

What happened?

A clear and concise description of your issue.
When using a reference for a text field (e. g. description), it doesn't get bundled in the Cursor Context.
What should have happened instead?

A clear and concise description of the behavior you expected to happen.
Field values should be loaded from reference file
Minimal reproducible OpenAPI snippet

If possible, include a short example of your OpenAPI definition that we can use to simulate the problem.

Screenshots

If applicable, add screenshots to help explain your problem.
Screenshot 2022-01-17 at 16 26 11
Additional context

Add any other information about the problem here, like: the extension version number; OpenAPI version you're using in your definition; your operating system.

Server must be present, spec says it's optional.

What happened?

Validation error is shown (red lines) if servers field is missing in spec.

What should have happened instead?

servers field is not required based on openapi 3.03.

Minimal reproducible OpenAPI snippet

openapi: 3.0.3
info: {title: '', version: ''}
components: {}
paths:
  /path:
    summary: TODO

Screenshots
Screenshot 2022-02-07 at 11 40 19

Additional context

Redocly OpenAPI v0.2.3

.redocly.yaml contents:

apiDefinitions:
  root: hidden.yaml
lint:
  extends:
    - recommended
  rules:
    tag-description: off
    operation-summary: error
    no-unresolved-refs: error
    no-unused-components: error
    operation-2xx-response: error
    operation-operationId: error
    operation-singular-tag: error
    no-enum-type-mismatch: error
    no-identical-paths: error
    no-ambiguous-paths: error

OpenAPI file with version other than 3.1.0 is marked invalid by editor

What happened?

A specification file with OpenAPI version set to 2.x or 3.0.x is marked as invalid.

What should have happened instead?

OpenAPI 2., 3.0 and 3.1 should be supported as described in the extension description. The validation rules should reflect the version specified in the file automatically.

Screenshots

image

Additional context

Extension version: Release 0.1.0 (2021-11-18)
VS Code version: Version: 1.63.0-insider

Double dollar sign ref

What happened?

This is best illustrated by a picture. I start to type $r and then select $ref and end up with $$ref:.
2022-03-20_09-42-46

What should have happened instead?

It should say $ref: (with a single dollar sign).

Minimal reproducible OpenAPI snippet

n/a

Screenshots

Posted above

Additional context

I hit this snag quite frequently, so I think it is a real inconvenience (at least for me).

Disable config init prompt for empty projects

What happened?

Every time I open an unrelated project not having a redocly config file (for example, a repo with c++ microcontroller code), extension asks if I want to initialize a config file.

What should have happened instead?

I would like to be able to disable this behavior in settings

Multiline text is inlined after saving/formatting

What happened?

Formatting is changed after saving

A clear and concise description of your issue.

The text before saving
image

The text after saving
image

What should have happened instead?

A clear and concise description of the behavior you expected to happen.

Text formating should not have changed

Minimal reproducible OpenAPI snippet

If possible, include a short example of your OpenAPI definition that we can use to simulate the problem.

openapi: 3.1.0
tags:
  - name: Example
    description: |
      Lorem Ipsum is simply dummy text of the
      printing and typesetting industry. 
      
      Lorem Ipsum has been the industry's standard 
      dummy text ever since the 1500s, 
      when an unknown printer took a galley of type 
      and scrambled it to make a type specimen book. 

Screenshots

If applicable, add screenshots to help explain your problem.

See above

Additional context

Add any other information about the problem here, like: the extension version number; OpenAPI version you're using in your definition; your operating system.

Strange behaviour in Cursor Context

What happened?

With Cursor Context opened, select several nodes in a definition file. The description in Cursor Context starts glimmering.

What should have happened instead?

It should not glimmer.

Minimal reproducible OpenAPI snippet

Any definition file.

Screenshots

Screen.Recording.2022-06-14.at.13.08.10.mov

Additional context

Most likely this happens because we show the context of the cursor position (which also happens to be the end of selection). We may want to use debounce, or otherwise always show the context of the first selected node.

WSL2 paths in $ref are being generated with an extraneous /

What happened?

All OpenAPI yaml files that have $ref values pointing at a relative "external" OpenAPI yaml file have the WSL2 file:// path generated with an extraneous / character after the "wsl", e.g.

file://wsl/%24/Ubuntu-20.04/home/steve/github/bbc/account-service-contract/openapi/base.yaml

This filepath is NOT valid in Windows Explorer, and nothing loads when pasting it into Windows Explorer address bar and pressing Enter.

What should have happened instead?

The WSL2 file locations should be generated without the / character following "wsl", e.g.

file://wsl%24/Ubuntu-20.04/home/steve/github/bbc/account-service-contract/openapi/base.yaml

This file URL is valid in Windows Explorer, and pasting this into its address bar and pressing Enter produces an Open File With dialog window, including the option to open in VS Code, which successfully opens.

Minimal reproducible OpenAPI snippet

main-example.yaml

openapi: '3.0.0'
info:
  title: '@project.name@'
  version: '@project.version@'
  description: main
servers:
  - url: http://localhost:8080
    description: Local development (Spring Boot)
paths:
  /v3/user/association:
    post:
      tags:
        - user
      summary: Create user association
      parameters:
        - $ref: 'base-example.yaml#/components/parameters/headerXray'
      description: The ref above currently generates a malformed WSL2 path in Redocly extension
      operationId: association
      responses:
        '204':
          description: Success. The account association was created.

base-example.yaml

openapi: '3.0.0'
info:
  description: blah
  version: '@project.version@'
  title: '@project.name@'
servers:
  - url: http://localhost:8080
    description: Local development (Spring Boot)
paths:
  /placeholder:
    get:
      summary: Placeholder
      description: |
        This is just a pretend API endpoint to satisfy the OpenAPI spec of having at least one
        URI path. It is **NOT** a real API path.
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
                example: dummy
components:
  parameters:
    headerXray:
      name: x-amzn-trace-id
      in: header
      description: "**Automatically Generated** upstream (if AWS X-Ray is enabled)"
      schema:
        type: string

Screenshots

This results in errors for all WSL2 paths in $ref values, e.g.

redoc-vscod-extension-wsl2-ref-path-error-example

You can see that the Windows UNC path is resolved to \\wsl\$\Ubuntu-20.04\home\steve\github\bbc\account-service-contract\openapi\base-example.yaml which is incorrect and should be \\wsl$\Ubuntu-20.04\home\steve\github\bbc\account-service-contract\openapi\base-example.yaml.

Additional context

VS Code is the Windows application. My OpenAPI project is on a Ubuntu filesystem in a WSL2 installation.

Redocly OpenAPI extension 0.2.2

Released on
13/08/2021, 14:29:18
Last updated
25/01/2022, 10:20:33
Identifier
redocly.openapi-vs-code
PS C:\Users\steve> wsl --list
Windows Subsystem for Linux Distributions:
Ubuntu-20.04 (Default)
docker-desktop-data
docker-desktop
Edition	Windows 10 Pro
Version	21H1
Installed on	‎27/‎06/‎2021
OS build	19043.1526
Experience	Windows Feature Experience Pack 120.2212.4170.0

info fields for cursor context form not working

What happened?

  1. Start with an API definition without any info.contact or info.license sections.
  2. Open cursor context
  3. Go to info
  4. Fill contact and license fields.
  5. Error: (YAML didn't change -- the sections already exist, then they do change, but it doesn't create the sections when they are filled out)

See the screenshot below.

What should have happened instead?

The YAML should change with the contact and license information.

openapi: 3.1.0
info:
  description: Document the EU API quickly
  title: EU Documents
  version: '1.0'
  contact:
    name: Test
    email: [email protected]
    url: https://redocly.com
  license:
    name: Test
    url: license.com

Minimal reproducible OpenAPI snippet

https://gist.github.com/adamaltman/66a0dacbc3ff769304db3d04456b5a47

Screenshots

image

Additional context

The key part is when there are no contact and license nodes to begin with...

[Live Share]: Clicking on a ref errors with path does not exist

What happened?

When you are in a live share session sometimes the plugin breaks from a an unknown point in time.
After that, when you click on a $ref link, vscode says the path does not exist.

If you have file x.yaml open the content of the error popup is: The path '/~1/x.yaml does not exist on this computer.

We have a live share session open with two workspace directories. The OAS file is in the second workspace dir.

What should have happened instead?

vscode should scroll to that reference.

Minimal reproducible OpenAPI snippet

redoc-cli says there are no validation errors so not sure if this helps here.

Additional context

Both participants have Linux 5.5.x installed and the latest vscode version installed

Unhandled /new-bundle method

What happened?

Errors about unhandled /new-bundle method show up

A clear and concise description of your issue.

Errors are randomly reported by vs code

What should have happened instead?

No errors in "Output" in "Debug Console View"

Screenshots

screenshot

Additional context

version: 0.2.3

Loading $ref by path doesn't work on Windows 10

What happened?

When resolving a $ref that points to an existing file the error appears:

What should have happened instead?

It should be able to bundle OpenAPI definition

Screenshots

Screenshot 2022-01-10 at 17 38 42

Additional context

More details here

Preview inconsistency with enums

What happened?

Notice the types and subtypes in this VS Code preview:

2022-02-03_21-30-55

Notice the same preview run with openapi preview-docs command (same exact API operation).

2022-02-03_21-34-18

It is not displaying the enum values.

What should have happened instead?

It should display the enum values.

Minimal reproducible OpenAPI snippet

rebilly/api-definitions (core API "create kyc request")

Additional context

  • VS Code extension: v0.2.3

Bug: `Problems` persist when file is closed

What happened?

When I open a file to lint, the Problems are displayed in the terminal editor as expected. When the file is closed, the problems persist in the terminal window.

What should have happened instead?

The Problems should be cleared for the closed file

A clear and concise description of the behavior you expected to happen.

I would really like to the see the Problems cleared for the closed file AND any external reference files associated to the original file.

Allow Enable/ Disable extension

What should we improve?
I need the ability to quickly enable / disable Redocly extension. Disable extension from the extensions menu requires VSC to reload and this is not an ideal workflow.

Here's an idea taken from Live Server extension, one click action
image

Parsing other yaml files leads to problem report without a source

What happened?

The extension tries to read all yaml files in the workspace and not all of them are OpenAPI. Any yaml with custom tags seem to confuse the extension. Rather than reporting nicely, it ends up with a problem without a "source".

[{
	"resource": "/path/to/example.yaml",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 8,
	"message": "unknown tag !<!GetAtt> in \"/path/to/example.yaml\" (12:13)",
	"startLineNumber": 12,
	"startColumn": 13,
	"endLineNumber": 12,
	"endColumn": 13
}]

What should have happened instead?

  • Handle reading non OpenAPI yaml with custom tags and report the issue with a "source" included so it is easier to track down.
  • It would be nice to allow explicit include / exclude of files / directories that the extension will check. Then it does not need to deal with files which aren't OpenAPI.

Minimal reproducible OpenAPI snippet

CloudFormation from: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/gettingstarted.templatebasics.html

Resources:
  myBucket:
    Type: 'AWS::S3::Bucket'
  myDistribution:
    Type: 'AWS::CloudFront::Distribution'
    Properties:
      DistributionConfig:
        Origins:
          - DomainName: !GetAtt 
              - myBucket
              - DomainName
            Id: myS3Origin
            S3OriginConfig: {}
        Enabled: 'true'
        DefaultCacheBehavior:
          TargetOriginId: myS3Origin
          ForwardedValues:
            QueryString: 'false'
          ViewerProtocolPolicy: allow-all

Additional context

This made it quite difficult to track down where the reported problem was coming from. It required disabling extensions until the problem disappeared to figure out it was Redocly.

Not resolving Markdown files used in $refs

What happened?

Version 0.2.0 has a reversion in that it says "Can't resolve $ref: files with [.md] extension aren't supported"

2022-01-16_11-57-52

This causes a cascade of other issues, such as preview-docs not working for this API.

What should have happened instead?

It should resolve Markdown files referenced. (OpenAPI cli does it.)

Minimal reproducible OpenAPI snippet

https://github.com/redocly-demo/whatsfordinner-api

Screenshots

Showing the preview-docs is not functional:

2022-01-16_12-02-39

Additional context

Being able to reference scalar values (most practical use case is Markdown descriptions) is practical and used extensively.

Get VS Code extension available in online editors

What should we improve?

At the moment, our extension isn't working in online editors.
However, Github Codespaces is essentially a an online VS Code emulator, so it should support using our extension.

How should we improve it?

Describe alternatives you've considered

None

Additional context

See this article for more details on developing extensions for Github Codespaces.

Type null in OpenAPI 3.0

What happened?
Suggest null in schema->type for OpenApi 3.0

What should have happened instead?
Null should not displayed in openapi 3.0 definition

Minimal reproducible OpenAPI snippet

openapi: 3.0.0
servers:
  - url: //petstore.swagger.io/v2
    description: Default server
info:
  description: Test
  version: 1.0.0
  title: Swagger Petstore
  termsOfService: 'http://swagger.io/terms/'
  contact:
    name: API Support
    email: [email protected]
    url: https://github.com/Redocly/redoc
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
paths:
  /pet:
    post:
      tags:
        - pet
      summary: Add a new pet to the store
      description: Add new pet to the store inventory.
      operationId: addPet
      responses:
        '200':
          description: wrong type suggestions
          content:
            application/json:
              schema:
                type: null <--here is problem

Screenshots

Screenshot 2023-05-18 at 16 58 58

feat: allow config file location in VSC settings

What should we improve?

please allow me to set the location of my config file in the VSC settings page. I don't always work in the same workspace where I store my config file and would like a global config to be available. Any workspace config should take precedence over the global config.

Support concise outline and symbol list

What should we improve?

Currently when navigating a long specification we have to rely on the YAML outline which is not quite convenient. Without semantics of openapi the outline is arbitrarily deep and hard to navigate. As a consequence, typing @ to search symbol brings too many results which are not useful. The following picture shows the condition:

截屏2022-10-10 13 11 33

截屏2022-10-10 13 11 56

How should we improve it?

It would be better to provide a seperate outline panel and help navigate paths and schemas. Also it would be useful if @ will bring paths and schemas only.

Why should we improve it?

OpenAPI docs are quite verbose and navigation is painful. This feature will greatly improve the experience.

Describe alternatives you've considered

Currently I manually collapse the YAML outline every time.

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.