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

Syncing new rules into main #34

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

Syncing new rules into main #34

wants to merge 16 commits into from

Conversation

jbend
Copy link
Member

@jbend jbend commented Jan 8, 2025

No description provided.

@jbend jbend requested a review from CarrieRaglan January 8, 2025 17:16
Copy link
Collaborator

@CarrieRaglan CarrieRaglan left a 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"]) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

return [
{
message:
"The path does not contains 'path' value in 'in' field of " +
Copy link
Collaborator

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.",
Copy link
Collaborator

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)) {
Copy link
Collaborator

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.
Copy link
Collaborator

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
Copy link
Collaborator

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.
Copy link
Collaborator

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.
Copy link
Collaborator

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants