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

Can't preview when resources include a securedBy node #10

Open
hotgazpacho opened this issue Oct 13, 2017 · 4 comments
Open

Can't preview when resources include a securedBy node #10

hotgazpacho opened this issue Oct 13, 2017 · 4 comments

Comments

@hotgazpacho
Copy link

raml2html --template /Users/wgreen/.vscode/extensions/blzjns.vscode-raml-3.0.1/raml2html_template/dark.nunjucks /Users/wgreen/Development/my-api-docs/my-api.raml
(/Users/wgreen/.vscode/extensions/blzjns.vscode-raml-3.0.1/raml2html_template/dark.nunjucks)
  Template render error: (/Users/wgreen/.vscode/extensions/blzjns.vscode-raml-3.0.1/raml2html_template/dark.nunjucks)
  Template render error: (/Users/wgreen/.vscode/extensions/blzjns.vscode-raml-3.0.1/raml2html_template/resource.nunjucks) [Line 71, Column 60]
  Error: Unable to call `renderSecuredBy`, which is undefined or falsey

RAML:

#%RAML 1.0
title: My API
version: 1.0
baseUri: https://myapi.example.com

securitySchemes:
  basicAuth:
    description: Each request must contain the headers necessary for basic authentication
    type: Basic Authentication
    describedBy:
      headers:
        Authorization:
          description: Used to send the Base64-encoded "username:password" credentials
          type: string
      responses:
        401:
          description: |
            Unauthorized. Either the provided username and password
            combination is invalid, or the user is not allowed to access
            the content provided by the requested URL.

types:
  foo-request: !include schemas/request.json
  foo-response: !include schemas/response.json

/foos
  securedBy:
  - basicAuth
  post:
    body:
      application/json:
        type: foo-request
    responses:
      200:
        body:
          application/json:
            type: foo-response
@modul
Copy link

modul commented Nov 14, 2018

Same problem here. But I guess nothing is happening here?

@kellerj
Copy link

kellerj commented Mar 4, 2019

Well - I was able to get the preview to sort of work by hacking the showPreview.js file in the extension to remove the template reference. (But the default template uses a popup overlay which does not seem to work inside of VS Code. So, it seems the template they have is the problem and needs to be updated.

@AddisonG
Copy link

With VS Code 1.33.0 vscode.previewHtml is deprecated.

Here is a commit of another extension which removed it from their code, and how they replaced it.
microsoft/vscode-postgresql@ff40314

@ageoghegan
Copy link

I'm also encountering this issue. This problem seems a pretty fundamental issue as I'd imagine the securedBy attribute is an important and core feature of documenting any API specification.

Gabrz added a commit to Gabrz/vscode-raml that referenced this issue Oct 19, 2020
Fixed and documented Issues( blzjns#9, blzjns#10, blzjns#18 and blzjns#19)

Added new Templates with Material Theme
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

5 participants