api-quality-spectral-ruleset 1.4.0 → 1.4.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apq-spectral.yaml +7 -7
- package/package.json +1 -1
package/apq-spectral.yaml
CHANGED
|
@@ -193,7 +193,7 @@ rules:
|
|
|
193
193
|
message: "OAR016: Numeric types must use a valid format for their type."
|
|
194
194
|
documentationUrl: "https://github.com/apiaddicts/apquality-spectral/blob/main/docs/resources/OAR016.md"
|
|
195
195
|
severity: error
|
|
196
|
-
given: "$..[?(@.type=='number' || @.type=='integer')]"
|
|
196
|
+
given: "$..[?(@ && (@.type=='number' || @.type=='integer'))]"
|
|
197
197
|
then:
|
|
198
198
|
function: schema
|
|
199
199
|
functionOptions:
|
|
@@ -514,7 +514,7 @@ rules:
|
|
|
514
514
|
message: "OAR037: String schemas must specify a valid format (date, date-time, password, byte, binary, email, uuid, uri, hostname, ipv4, ipv6, HEX, HEX(16), json, xml, or base64), or a valid pattern when no format is defined."
|
|
515
515
|
severity: error
|
|
516
516
|
resolved: false
|
|
517
|
-
given: "$..[?(@.type=='string')]"
|
|
517
|
+
given: "$..[?(@ && @.type=='string')]"
|
|
518
518
|
then:
|
|
519
519
|
function: apq-schema-format
|
|
520
520
|
apiq:OAR038:
|
|
@@ -715,7 +715,7 @@ rules:
|
|
|
715
715
|
message: "OAR052: Numeric types requires a format"
|
|
716
716
|
documentationUrl: "https://github.com/apiaddicts/apquality-spectral/blob/main/docs/resources/OAR052.md"
|
|
717
717
|
severity: warn
|
|
718
|
-
given: "$..[?(@.type == 'integer' || @.type == 'number')]"
|
|
718
|
+
given: "$..[?(@ && (@.type == 'integer' || @.type == 'number'))]"
|
|
719
719
|
then:
|
|
720
720
|
field: format
|
|
721
721
|
function: truthy
|
|
@@ -903,7 +903,7 @@ rules:
|
|
|
903
903
|
description: "Numeric parameters should have minimum, maximum, or format restriction."
|
|
904
904
|
message: "OAR074: Numeric parameter '{{property}}' should have a minimum, maximum, or format restriction."
|
|
905
905
|
severity: error
|
|
906
|
-
given: "$.paths[*][get,post,put,patch,delete].parameters[?(@.schema.type == 'integer' || @.schema.type == 'number')]"
|
|
906
|
+
given: "$.paths[*][get,post,put,patch,delete].parameters[?(@ && @.schema && (@.schema.type == 'integer' || @.schema.type == 'number'))]"
|
|
907
907
|
then:
|
|
908
908
|
function: schema
|
|
909
909
|
functionOptions:
|
|
@@ -919,7 +919,7 @@ rules:
|
|
|
919
919
|
description: "String parameters should have minLength, maxLength, pattern (regular expression), or enum restriction."
|
|
920
920
|
message: "OAR075: String parameters should have minLength, maxLength, pattern, or enum restriction."
|
|
921
921
|
severity: error
|
|
922
|
-
given: "$.paths[*][get,post,put,patch,delete].parameters[?(@.schema.type == 'string' && @.in == 'path')]"
|
|
922
|
+
given: "$.paths[*][get,post,put,patch,delete].parameters[?(@ && @.schema && @.schema.type == 'string' && @.in == 'path')]"
|
|
923
923
|
then:
|
|
924
924
|
function: schema
|
|
925
925
|
functionOptions:
|
|
@@ -937,7 +937,7 @@ rules:
|
|
|
937
937
|
message: "OAR076: Schema should use well-defined type and format."
|
|
938
938
|
documentationUrl: "https://github.com/apiaddicts/apquality-spectral/blob/main/docs/resources/OAR076.md"
|
|
939
939
|
severity: error
|
|
940
|
-
given: "$..[?(@.type=='number' || @.type=='integer')]"
|
|
940
|
+
given: "$..[?(@ && (@.type=='number' || @.type=='integer'))]"
|
|
941
941
|
then:
|
|
942
942
|
function: schema
|
|
943
943
|
functionOptions:
|
|
@@ -1009,7 +1009,7 @@ rules:
|
|
|
1009
1009
|
description: "The string properties 'product', 'line', and 'price' must define a byte or binary format."
|
|
1010
1010
|
message: "{{error}}"
|
|
1011
1011
|
severity: error
|
|
1012
|
-
given: "$..[?(@.properties)]"
|
|
1012
|
+
given: "$..[?(@ && @.properties)]"
|
|
1013
1013
|
then:
|
|
1014
1014
|
function: apq-binary-format-check
|
|
1015
1015
|
functionOptions:
|