-
Notifications
You must be signed in to change notification settings - Fork 5
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
Syncing new rules into main #34
base: main
Are you sure you want to change the base?
Conversation
Fixing package json
…api-spectral-rules into develop" This reverts commit 4c63c33, reversing changes made to c3b1abb.
…library and ruleset
…ined-rules Trimble API Standards enforcement with refined rules and removed POS …
…ined-rules Addressed the PR issues reported
Updating documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments for requested changes
message: "The error payload must contain title property", | ||
}, | ||
]; | ||
} else if (!error["message"]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"message" is not a required field: https://api-standards.trimble-pnp.com/api-standard/http#standard-error-payload-schema
return [ | ||
{ | ||
message: | ||
"The path does not contains 'path' value in 'in' field of " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameters may be defined outside of each individual operation.
https://spec.openapis.org/oas/v3.0.3#fixed-fields-6
return [ | ||
{ | ||
message: | ||
"All APIs that return structured data MUST be able to return that data formatted as JSON at a minimum and as the default.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be an error, as All APIs that return structured data SHOULD be able to return that data formatted as JSON at a minimum.
https://developer.trimble.com/docs/api-standard/interchange-formats
|
||
// Check if any of the HTTP verbs are present in the URL | ||
for (const verb of httpVerbs) { | ||
if (uppercaseUrl.includes(verb)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail on words that include the verbs, such as traceTypes, widgets
|
||
### tas-openapi-v3-schema-properties-names-camel-case | ||
|
||
All schema property names should be camel case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is set to severity: error, and should say MUST instead of "should"
All schema property names MUST be camel case.
|
||
Spec should contain only valid http verbs (Additional ruleset) | ||
|
||
### tdp-spec-should-not-be-empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is set to severity: error, and should say MUST instead of "should"
tdp-operation-delete-204-status-code: | ||
# All DELETE methods should have a 204 response | ||
# https://api-standards.trimble-pnp.com/api-standard/http#successful-responses-2xx | ||
tas-operation-delete-204-status-code: | ||
description: All DELETE methods should have a 204 response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is set to severity: error, and should say MUST instead of "should"
@@ -87,7 +211,8 @@ rules: | |||
field: "204" | |||
function: truthy | |||
|
|||
# Trimble Web API Standards | |||
# All POST methods should have a 201 or 202 response. | |||
# https://api-standards.trimble-pnp.com/api-standard/http#successful-responses-2xx | |||
tdp-operation-post-201-202-status-code: | |||
description: All POST methods should have a 201 or 202 response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is set to severity: error, and should say MUST instead of "should"
No description provided.