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

docs: add arazzo rules documentation #1697

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

DmitryAnansky
Copy link
Contributor

What/Why/How?

Add documentation for Arazzo and AsyncAPI rules

Reference

Closes: #1691

Testing

Screenshots (optional)

Check yourself

  • Code changed? - Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests
  • New package installed? - Tested in different environments (browser/node)

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

Copy link

changeset-bot bot commented Aug 29, 2024

⚠️ No Changeset found

Latest commit: 91b04e4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Aug 29, 2024

Command Mean [ms] Min [ms] Max [ms] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 980.8 ± 16.6 951.2 1011.4 1.00
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 1016.0 ± 17.2 989.8 1049.0 1.04 ± 0.02

Copy link
Contributor

github-actions bot commented Aug 29, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.58% 4993/6354
🟡 Branches 67.24% 2063/3068
🟡 Functions 73.01% 825/1130
🟡 Lines 78.87% 4711/5973
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / sourceDescriptions-type.ts
100% 100% 100% 100%

Test suite run success

810 tests passing in 121 suites.

Report generated by 🧪jest coverage report action from 91b04e4

@tatomyr tatomyr changed the title chore: add arazzo rules documentation docs: add arazzo rules documentation Aug 30, 2024
@@ -27,6 +27,12 @@ Errors:
- [security-defined](./security-defined.md)
- [spec-components-invalid-map-name](./spec-components-invalid-map-name.md)
- [spec](./spec.md)
- [parameters-unique](./arazzo/parameters-unique.md)
Copy link
Contributor Author

@DmitryAnansky DmitryAnansky Aug 30, 2024

Choose a reason for hiding this comment

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

It seems to me that we need a different structure for rules documentation.
The current version does not diverse OAS rules from AsyncAPI and Arazzo rules.
It's easy to be confused and mix spec-specific rules without checking rule details.

cc: @lornajane , @tatomyr

Copy link
Member

Choose a reason for hiding this comment

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

I agree. Maybe groups like "OpenAPI", and "Arazzo".

Copy link
Member

@adamaltman adamaltman Sep 4, 2024

Choose a reason for hiding this comment

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

Or separator labels.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, definitely. I'll push some changes to this branch and try to make it easier to understand.

Copy link
Contributor

Choose a reason for hiding this comment

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

Mmmm, I added the ruleset-templates page with all the rulesets for all the formats listed. Maybe I should have split that information onto these existing minimal and recommended documentation pages though, does anyone have an opinion?

Copy link
Contributor

Choose a reason for hiding this comment

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

Updated to reflect only having documentation for per-API configuration and keeping the per-format information as an internal-only implementation detail for now.

docs/rules/spec.md Outdated Show resolved Hide resolved
@jeremyfiel
Copy link
Contributor

sorry to give duplicate work but most of the arazzo defined rules in this pr are handled by the recently merged JSON Schema definition for Arazzo 1.0. It's currently in the 1.0.0-dev branch but is expected to be merged to main very soon.

https://github.com/OAI/Arazzo-Specification/pull/224/files#diff-c3b79a68b0d389644801b367021ceb2169c0a1afbdec651107b11605db4671c2

@DmitryAnansky
Copy link
Contributor Author

DmitryAnansky commented Sep 4, 2024

sorry to give duplicate work but most of the arazzo defined rules in this pr are handled by the recently merged JSON Schema definition for Arazzo 1.0. It's currently in the 1.0.0-dev branch but is expected to be merged to main very soon.

https://github.com/OAI/Arazzo-Specification/pull/224/files#diff-c3b79a68b0d389644801b367021ceb2169c0a1afbdec651107b11605db4671c2

@jeremyfiel Thank you for your contribution, having an official JSON Schema is great and will be applied for generating types,
but we'll use these rules to validate internal type mapping, as the JSON schema might not fully address some nested cases or apply entirely to the internally mapped types.

Copy link
Contributor

@lornajane lornajane left a comment

Choose a reason for hiding this comment

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

Thanks for creating the pages for each rule, this is a great start! I will do some copy editing (I'll just push the changes if you don't mind), and figure out how to structure the information for the different description formats, but I need a few more things from you @DmitryAnansky if possible:

  • answer the open questions on the PR, I can transfer the answer to all the pages where it's something that comes up repeatedly
  • add some words for each of the mermaid charts, I'm not sure what we're trying to express here
  • can we say what problem each rule solves? I think if I knew that, I could do the rest of the updates and then request your review.

docs/guides/lint-asyncapi.md Show resolved Hide resolved
docs/guides/lint-asyncapi.md Show resolved Hide resolved
docs/rules/arazzo/parameters-unique.md Outdated Show resolved Hide resolved
docs/rules/arazzo/parameters-unique.md Outdated Show resolved Hide resolved
docs/rules/arazzo/requestBody-replacements-unique.md Outdated Show resolved Hide resolved
docs/rules/minimal.md Show resolved Hide resolved
docs/rules/minimal.md Show resolved Hide resolved
@@ -27,6 +27,12 @@ Errors:
- [security-defined](./security-defined.md)
- [spec-components-invalid-map-name](./spec-components-invalid-map-name.md)
- [spec](./spec.md)
- [parameters-unique](./arazzo/parameters-unique.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, definitely. I'll push some changes to this branch and try to make it easier to understand.

docs/rules/spec.md Outdated Show resolved Hide resolved
docs/rules/spot/parameters-not-in-body.md Outdated Show resolved Hide resolved
@lornajane lornajane marked this pull request as ready for review October 7, 2024 10:11
@lornajane lornajane requested review from a team as code owners October 7, 2024 10:11
@lornajane
Copy link
Contributor

Can I get some reviews on this, please? There's one open conversation about page structure but otherwise I am pretty happy with how this turned out and kudos to @DmitryAnansky for all the hard work - both on the feature and on the docs!

Copy link
Member

@adamaltman adamaltman left a comment

Choose a reason for hiding this comment

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

We're going to have to discuss this offline. I'm not in agreement to move forward with this as it is.

Copy link
Member

@adamaltman adamaltman left a comment

Choose a reason for hiding this comment

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

I have quite a few issues and things to discuss.

Comment on lines +48 to +51
- target: name
value: 'new name'
- target: name
value: 'another name'
Copy link
Member

Choose a reason for hiding this comment

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

This example is invalid not because of duplicate targets, but because targets must be JSON Pointer or XPath. This is not.

Suggested change
- target: name
value: 'new name'
- target: name
value: 'another name'
- target: /name
value: 'new name'
- target: /name
value: 'another name'

Comment on lines +67 to +70
- target: name
value: 'new name'
- target: description
value: 'another description'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- target: name
value: 'new name'
- target: description
value: 'another description'
- target: /name
value: 'new name'
- target: /description
value: 'another description'

docs/rules/arazzo/sourceDescriptions-name-unique.md Outdated Show resolved Hide resolved
docs/rules/arazzo/sourceDescriptions-name-unique.md Outdated Show resolved Hide resolved
docs/rules/arazzo/sourceDescriptions-name-unique.md Outdated Show resolved Hide resolved
docs/rules/arazzo/workflowId-unique.md Outdated Show resolved Hide resolved
docs/rules/async/channels-kebab-case.md Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

These should be in the Arazzo folder. There shouldn't be any rules specific to Spot. Spot uses Arazzo files with some specification extensions that can be validated.

@@ -0,0 +1,69 @@
# parameters-not-in-body

Requires the `in` section inside `parameters` must not contain a `body`.
Copy link
Member

Choose a reason for hiding this comment

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

This rule doesn't make sense. We should fix Spot's support for parameters in body.

Copy link
Member

Choose a reason for hiding this comment

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

This is not a spot rule. This should be part of the Arazzo spec rule. This shouldn't be a separate rule.

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.

Add documentation for Arazzo rules and linting
6 participants