Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dweber019
Copy link
Contributor

@dweber019 dweber019 commented Mar 29, 2023

Fixes #1488.

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

Screenshots
CleanShot 2023-03-29 at 23 51 42@2x
CleanShot 2023-03-29 at 23 52 26@2x

All formatters have been updated.

@dweber019
Copy link
Contributor Author

Should we add the docuemtnUrl type here stoplightio/types#127?

@nahteb
Copy link

nahteb commented Mar 30, 2023

thanks for raising this PR, we've just recently added documentationUrls to our ruleset and would find this really useful 👍

@dweber019
Copy link
Contributor Author

@magicmatatjahu @smoya @jonaslagoni any update on this?

@jonaslagoni
Copy link
Collaborator

I dont get why we are assigned tbh. @P0lip this is a core change, while it does change something for the AsyncAPI rules, this is all you 😄

@jonaslagoni jonaslagoni requested a review from P0lip April 25, 2023 18:38
@mnaumanali94
Copy link
Contributor

👋🏼 @dweber019 First of all, I would like to apologize for the delay in responding to your pull request. We appreciate your valuable contribution to the project.

We understand your intention to output the documentation URL as part of the lint process. However it may clutter the output and become repetitive. Additionally, not all organizations utilize the documentation URL, and some prefer using the description field.

With that in mind, we would like to propose a couple of alternative options:

Add the functionality to output the documentationURL behind the --verbose flag. This would make it an opt-in feature, giving users the choice to include the documentation URL in their lint output. The downside to this approach is that it may not cater to organizations that use the description field instead of the documentationURL.
Introduce a new spectral ruleset explain command that displays information for each rule, including severity, documentationURL, and description. This would provide a more comprehensive overview of the rules without cluttering the lint output.
We would love to hear your thoughts on these approaches or any other ideas you might have. Once we have your input, we can work together to make the necessary changes and integrate them into the project.

Thank you once again for your contribution, and we look forward to collaborating with you on this feature.

@dweber019
Copy link
Contributor Author

Hi @mnaumanali94

Thx for the feedback. I agree with you. It depends on the use case.
How would you imagine this explain command.

  1. Is this a options flag on lint, and if a rule fails more output is generated
  2. or is it a standalone command to basically extract rule information from the rules file without linting?

For our use case, the first one would satisfy our needs and makes IMHO more sense, as the documentation url or description is needed in case of error mostly on CI side, where you don't like to rerun a command to understand the error.

@P0lip P0lip force-pushed the develop branch 7 times, most recently from dc9d7f4 to 44c40e2 Compare May 23, 2023 22:56
@P0lip P0lip force-pushed the develop branch 4 times, most recently from 02ec0d4 to 84faec8 Compare June 9, 2023 19:43
@ShelleeNikole
Copy link

@dweber019 Thanks you for raising this issue and for your contribution. I have a similar requirement to make use of the documenationUrl property in Javascript.

@mnaumanali94 Any idea if this PR will be accepted and merged anytime soon?

Cheers!

@P0lip P0lip force-pushed the develop branch 3 times, most recently from 9e92f34 to 6d09915 Compare September 20, 2023 18:42
@P0lip P0lip force-pushed the develop branch 2 times, most recently from 1a04f25 to dc90b7a Compare April 4, 2024 13:19
@dweber019 dweber019 force-pushed the feat/expose-documentation-url branch from 6e15f43 to 08ba0bc Compare June 10, 2024 19:22
@mnaumanali94
Copy link
Contributor

LGTM!

mnaumanali94
mnaumanali94 previously approved these changes Jul 11, 2024
@dweber019
Copy link
Contributor Author

@jonaslagoni @smoya could someone of you check this pr. Thanks a lot

jonaslagoni
jonaslagoni previously approved these changes Oct 11, 2024
Copy link
Collaborator

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonaslagoni @smoya could someone of you check this pr. Thanks a lot

As mentioned earlier, no need for us to review core changes that affects AsyncAPI rules or outputs of it 🙂

@austinmehmet
Copy link

Any update on this? Would really appreciate this feature so we can produce better HTML reports that link to our documentation

@frankkilcommins frankkilcommins requested review from frankkilcommins and removed request for ryotrellim March 13, 2025 09:48
@frankkilcommins
Copy link
Contributor

@dweber019 I've reviewed and this is looking good. I've also resolved the merge conflicts and merged in the latest from origin/develop.

Some of the documentation-url tests are failing. Could you take a look and we can make sure to get this merged and released?

@mnaumanali94
Copy link
Contributor

@dweber019 gentle nudge on this. Would you be able to take a stab at fixing the tests.

Copy link
Contributor

@frankkilcommins frankkilcommins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@frankkilcommins frankkilcommins merged commit e787728 into stoplightio:develop Apr 18, 2025
7 checks passed
stoplight-bot pushed a commit that referenced this pull request Apr 22, 2025
# @stoplight/spectral-formatters [1.5.0](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-formatters-1.4.3...@stoplight/spectral-formatters-1.5.0) (2025-04-22)

### Features

* **core:** add documentUrl to JS api and cli formatters ([#2443](#2443)) ([e787728](e787728))
stoplight-bot pushed a commit that referenced this pull request Apr 22, 2025
# [6.15.0](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-cli-6.14.3...@stoplight/spectral-cli-6.15.0) (2025-04-22)

### Bug Fixes

* **deps:** bump elliptic from 6.6.0 to 6.6.1 ([#2782](#2782)) ([5ff9602](5ff9602))
* **repo:** replace discord link with forum link ([#2793](#2793)) ([6229442](6229442))

### Features

* **core:** add documentUrl to JS api and cli formatters ([#2443](#2443)) ([e787728](e787728))
* **functions:** add or function ([#2798](#2798)) ([d9ef27f](d9ef27f))
stoplight-bot pushed a commit that referenced this pull request Apr 22, 2025
# [1.20.0](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-core-1.19.5...@stoplight/spectral-core-1.20.0) (2025-04-22)

### Bug Fixes

* **deps:** bump elliptic from 6.6.0 to 6.6.1 ([#2782](#2782)) ([5ff9602](5ff9602))
* **deps:** fix yarn lockfile ([e6c3b9d](e6c3b9d))
* **deps:** update spectral-core in cli ([35687cd](35687cd))
* **repo:** replace discord link with forum link ([#2793](#2793)) ([6229442](6229442))

### Features

* **core:** add documentUrl to JS api and cli formatters ([#2443](#2443)) ([e787728](e787728))
* **functions:** add or function ([#2798](#2798)) ([d9ef27f](d9ef27f))
@stoplight-bot
Copy link
Collaborator

🎉 This PR is included in version 1.20.0 🎉

The release is available on @stoplight/spectral-core-1.20.0

Your semantic-release bot 📦🚀

stoplight-bot pushed a commit that referenced this pull request Apr 22, 2025
# [1.10.0](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-functions-1.9.4...@stoplight/spectral-functions-1.10.0) (2025-04-22)

### Bug Fixes

* **deps:** bump elliptic from 6.6.0 to 6.6.1 ([#2782](#2782)) ([5ff9602](5ff9602))
* **deps:** fix yarn lockfile ([e6c3b9d](e6c3b9d))
* **deps:** update spectral-core in cli ([35687cd](35687cd))
* **repo:** replace discord link with forum link ([#2793](#2793)) ([6229442](6229442))

### Features

* **core:** add documentUrl to JS api and cli formatters ([#2443](#2443)) ([e787728](e787728))
* **functions:** add or function ([#2798](#2798)) ([d9ef27f](d9ef27f))
stoplight-bot pushed a commit that referenced this pull request Apr 22, 2025
# [1.22.0](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-rulesets-1.21.4...@stoplight/spectral-rulesets-1.22.0) (2025-04-22)

### Bug Fixes

* **deps:** bump elliptic from 6.6.0 to 6.6.1 ([#2782](#2782)) ([5ff9602](5ff9602))
* **deps:** fix yarn lockfile ([e6c3b9d](e6c3b9d))
* **deps:** update spectral-core in cli ([35687cd](35687cd))
* **repo:** replace discord link with forum link ([#2793](#2793)) ([6229442](6229442))

### Features

* **core:** add documentUrl to JS api and cli formatters ([#2443](#2443)) ([e787728](e787728))
* **functions:** add or function ([#2798](#2798)) ([d9ef27f](d9ef27f))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make documentationUrl available as part of Javascript API linting result

9 participants