You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Custom Rulesets**: Create custom rules to lint JSON or YAML objects
5
-
-**Ready-to-use Rulesets**: Validate and lint **OpenAPI v2& v3.x**, **AsyncAPI**, and **Arazzo v1** Documents
5
+
-**Ready-to-use Rulesets**: Validate and lint **OpenAPI v2, v3.0, v3.1 & v3.2**, **AsyncAPI**, and **Arazzo v1** Documents
6
6
-**API Style Guides**: Automated [API Style Guides](https://stoplight.io/api-style-guides-guidelines-and-best-practices?utm_source=github.com&utm_medium=referral&utm_campaign=github_repo_spectral) using rulesets improve consistency across all your APIs
7
7
-**Ready-to-use Functions**: Built-in set of functions to help [create custom rules](https://meta.stoplight.io/docs/spectral/e5b9616d6d50c-custom-rulesets#adding-rules). Functions include pattern checks, parameter checks, alphabetical ordering, a specified number of characters, provided keys are present in an object, etc.
8
8
-**Custom Functions**: Create custom functions for advanced use cases
Copy file name to clipboardExpand all lines: docs/getting-started/4-openapi.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,6 @@
2
2
3
3
Spectral has a built-in [OpenAPI Specification](https://openapis.org/specification) ruleset that you can use to validate your OpenAPI files.
4
4
5
-
Add `extends: "spectral:oas"` ("oas" being shorthand for OpenAPI Specification) to your ruleset file to apply rules for OpenAPI v2and v3.x, depending on the appropriate OpenAPI version being used (this is automatically detected through [formats](../getting-started/3-rulesets.md#formats)).
5
+
Add `extends: "spectral:oas"` ("oas" being shorthand for OpenAPI Specification) to your ruleset file to apply rules for OpenAPI v2, v3.0, v3.1, and v3.2, depending on the appropriate OpenAPI version being used (this is automatically detected through [formats](../getting-started/3-rulesets.md#formats)).
6
6
7
7
You can see a full list of the rules in this ruleset in [OpenAPI Rules](../reference/openapi-rules.md).
Copy file name to clipboardExpand all lines: docs/reference/openapi-rules.md
+42-6Lines changed: 42 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ In your ruleset file you can add `extends: "spectral:oas"` and you'll get all of
6
6
7
7
## OpenAPI v2 & v3
8
8
9
-
These rules apply to both OpenAPI v2.0, v3.0, and most likely v3.1, although there are some differences.
9
+
These rules apply to OpenAPI v2.0, v3.0, v3.1, and v3.2, although there are some differences.
10
10
11
11
### contact-properties
12
12
@@ -635,7 +635,7 @@ paths:
635
635
636
636
## OpenAPI v3-only
637
637
638
-
These rules will only be applied to OpenAPI v3.0 documents.
638
+
These rules will only be applied to OpenAPI v3.0, v3.1, and v3.2 documents.
639
639
640
640
### oas3-api-servers
641
641
@@ -696,7 +696,7 @@ Parameter objects should have a `description`.
696
696
### oas3-schema
697
697
698
698
Validate structure of OpenAPI v3 specification.
699
-
If OpenAPI 3.1.0 is used, `jsonSchemaDialect` is not respected and the draft 2020-12 is applied.
699
+
If OpenAPI 3.1 or 3.2 is used, `jsonSchemaDialect` is not respected and the draft 2020-12 is applied.
700
700
If you define your own `jsonSchemaDialect`, you'll most likely want to disable this rule.
701
701
702
702
**Recommended:** Yes
@@ -880,7 +880,7 @@ schemas:
880
880
881
881
### oas3-server-variables
882
882
883
-
This rule ensures that server variables defined in OpenAPI Specification 3 (OAS3)and 3.1 are valid, not unused, and result in a valid URL. Properly defining and using server variables is crucial for the accurate representation of API endpoints and preventing potential misconfigurations or security issues.
883
+
This rule ensures that server variables defined in OpenAPI Specification 3 (OAS3), 3.1, and 3.2 are valid, not unused, and result in a valid URL. Properly defining and using server variables is crucial for the accurate representation of API endpoints and preventing potential misconfigurations or security issues.
884
884
885
885
**Recommended**: Yes
886
886
@@ -975,7 +975,7 @@ paths:
975
975
976
976
### oas3_1-servers-in-webhook
977
977
978
-
Servers should not be defined in a webhook.
978
+
Servers should not be defined in a webhook. Applies to OpenAPI v3.1 and v3.2.
979
979
980
980
**Recommended:** Yes
981
981
@@ -1004,7 +1004,7 @@ webhooks:
1004
1004
1005
1005
### oas3_1-callbacks-in-webhook
1006
1006
1007
-
Callbacks should not be defined in a webhook.
1007
+
Callbacks should not be defined in a webhook. Applies to OpenAPI v3.1 and v3.2.
1008
1008
1009
1009
**Recommended:** Yes
1010
1010
@@ -1016,3 +1016,39 @@ webhooks:
1016
1016
post:
1017
1017
callbacks: ...
1018
1018
```
1019
+
1020
+
## OpenAPI v3.2-only
1021
+
1022
+
These rules will only be applied to OpenAPI v3.2 documents.
1023
+
1024
+
### oas3_2-no-deprecated-xml-attribute
1025
+
1026
+
The `xml.attribute` field is deprecated in OpenAPI v3.2. Use `xml.nodeType: attribute` instead.
0 commit comments