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

duplicate paths cause API viewer to go blank #18

Closed
JasonHenriksen opened this issue Sep 25, 2019 · 3 comments
Closed

duplicate paths cause API viewer to go blank #18

JasonHenriksen opened this issue Sep 25, 2019 · 3 comments

Comments

@JasonHenriksen
Copy link

JasonHenriksen commented Sep 25, 2019

If you enter the same path twice, the entire API viewer goes blank and you do not get an error in the editor.

openapi: '3.0.2'
info:
  title: Swagger Petstore
  version: '1.0.0'
servers:
  - url: https://auth2.clearcollateral.com/
paths:

  /v1/authentications:
    post:
      tags:
        - authenticate
      summary: 
        Authenticate a user.  ( Needs to be used as the SECaaS wrapper )
      responses:
        '200':
          description: asedf
        '400':
          description: asedf
        '500':
          description: asedf

  /v1/authentications:
    post:
      tags:
        - authenticate
      summary: 
        Authenticate a user.  ( Needs to be used as the SECaaS wrapper )
      responses:
        '200':
          description: asedf
        '400':
          description: asedf
        '500':
          description: asedf

This will not load in the viewer. But if you remove the second path, it will suddenly load.

This should be marked as an error in the editor, but not cause the viewer to go blank.

@ak1394
Copy link
Collaborator

ak1394 commented Sep 26, 2019

Thanks for reporting! It indeed does not report parsing errors, I'll fix it.

@ak1394
Copy link
Collaborator

ak1394 commented Oct 7, 2019

Editor needs to be able to parse JSON or YAML in order to display paths, etc. While duplicate paths issue is relatively benign and parser can sometimes work while encountering errors, other types of parsing errors could cause incorrect information to be displayed by the editor.

So, to err on the side of caution I'm going to keep current implementation where editor goes blank when parsing errors are encountered.

To alert user about parsing errors I've updated extension to display these in Errors panel of VS Code. The fix should be available in the upcoming 1.8.18 update.

Please comment if you disagree with the fix.

@ak1394 ak1394 closed this as completed Oct 7, 2019
@JasonHenriksen
Copy link
Author

I think the more extensive error display is definitely the correct way to go. Thank you.

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