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

documentationUrl not used in reports #416

Open
liveaverage opened this issue Jan 17, 2024 · 4 comments
Open

documentationUrl not used in reports #416

liveaverage opened this issue Jan 17, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@liveaverage
Copy link

Despite setting documentationUrl in the ruleset, the generated html report still references quobix.com:

image

Sample ruleset:

extends: [[spectral:oas, off]]
documentationUrl: "https://my-url.com/custom-rulesets#documentation-url"
rules:
  operation-operationId: true
  info-contact: true

Sample spec:

  "openapi": "3.0.1",
  "info": {
    "title": "Test Service",
    "termsOfService": "https://www.mysite.com/en-us/legal_info",
    "version": "v2.61.11"
  },
  "servers": [
    {
      "url": "https://stg.mysite.com",
      "description": "Generated server url"
    }
  ],
...

Is there another parameter that should be set? Is this the only area using documentationUrl for linting errors, or should we see this referenced in CLI output as well?

@liveaverage
Copy link
Author

Ah, this looks to be hardcoded at the moment:

href="https://quobix.com/vacuum/rules/${this.category.toLowerCase()}/${this.ruleId

Should documentationUrl be rendered/utilized somewhere outside the html-report?

@daveshanley
Copy link
Owner

This is the first use-case I have heard where someone would like to change the URL in the report. Happy to add this in, could you tell me more about how you would like to use the URL and what you would expect in the html-report and other commands?

@liveaverage
Copy link
Author

Absolutely! This is a gap I noticed in Spectral as well... they actually reference a common use case for documentationUrl but I don't see it actually used anywhere [within their core product] as described. I'm guessing it's consumed as a part of their Studio product, but we typically provide governance & reporting via pipelines: https://docs.stoplight.io/docs/spectral/e5b9616d6d50c-rulesets#documentation-url

A couple ideas come to mind with regard to html-report:

  • Template documentationUrl + an anchor link corresponding to the rule name, which would allow a quick reference to a more robust & informative API style guide entry
  • As an alternative (or addition), the ability to reference documentationUrl as a template parameter within the rule description, message, or custom howToFix field would be amazing and allow references in or out of html-reports, independent of the "Learn more about:" section.

@daveshanley
Copy link
Owner

Interesting, sounds like a nice upgrade.

@daveshanley daveshanley added enhancement New feature or request and removed need more input labels Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants