-
Notifications
You must be signed in to change notification settings - Fork 14
CLOUDP-310538: Remove duplicate legacy rules #669
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,18 +16,6 @@ aliases: | |
| - "$.components.schemas[*]..properties[?(@ && @.type)]" | ||
|
|
||
| rules: | ||
| xgen-schema-properties-camel-case: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you check if there are overrides for these below that can be removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overrides removed for all the removed legacy Spectral rules 👍 |
||
| description: | ||
| All properties in the schema must be camelCase. http://go/ipa/112 | ||
| severity: error | ||
| recommended: true | ||
| message: "`{{property}}` MUST follow camelCase" | ||
| given: "$.components.schemas..properties[*]~" | ||
| then: | ||
| function: pattern # casing? | ||
| functionOptions: | ||
| match: "/^[a-z$_]{1}[A-Z09$_]*/" # type: camel ? | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [To ensure] Is that regexp exactly the same that the one we have or it is least restrictive? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are using Spectral's camel casing rule, such as |
||
|
|
||
| xgen-schema-name-pascal-case: | ||
| description: OpenAPI Schema names should use PascalCase. PascalCase ensures consistency with OpenAPI generated code. | ||
| message: "`{{property}}` name must follow PascalCase. Please verify if you have provided valid @Schema(name='') annotation" | ||
|
|
@@ -38,41 +26,6 @@ rules: | |
| functionOptions: | ||
| match: "^[A-Z].*" # type: pascal ? | ||
|
|
||
| xgen-description: | ||
| description: "Use this field to describe the action performed by each specific API endpoint or property, to provide context for how to use it to the users of the API." | ||
| message: "{{error}}." | ||
| severity: error | ||
| given: "#DescribableObjects" | ||
| then: | ||
| - field: "description" | ||
| function: truthy | ||
| - field: "description" | ||
| function: pattern | ||
| functionOptions: | ||
| match: "/^[A-Z]/" | ||
| - field: "description" | ||
| function: pattern | ||
| functionOptions: | ||
| match: "\\.|\|$" | ||
|
|
||
| xgen-request-GET-no-body: | ||
| description: "A 'GET' request MUST NOT accept a 'body` parameter. http://go/ipa/104" | ||
| severity: error | ||
| given: $.paths..get.parameters..in | ||
| then: | ||
| function: pattern | ||
| functionOptions: | ||
| notMatch: "/^body$/" | ||
|
|
||
| xgen-request-DELETE-no-body: | ||
| description: "A 'DELETE' request MUST NOT accept a 'body` parameter. http://go/ipa/108" | ||
| severity: error | ||
| given: $.paths..delete.parameters..in | ||
| then: | ||
| function: pattern | ||
| functionOptions: | ||
| notMatch: "/^body$/" | ||
|
|
||
| xgen-docs-tags-alphabetical: | ||
| message: "Tags should be defined in alphabetical order." | ||
| description: "Many documentation tools show tags in the order they are defined, so defining them not in alphabetical order can look funny to API consumers." | ||
|
|
@@ -185,17 +138,6 @@ rules: | |
| match: "^mms(,[a-zA-Z0-9_-]+)*$" | ||
| message: "'additionalServices' must start with 'mms' and can include additional services in a comma-separated format." | ||
|
|
||
| no-slash-before-custom-method: | ||
| description: "Custom methods (e.g., ':applyItem') should not be preceded by a '/'." | ||
| message: "The path '{{path}}' contains a '/' before a custom method. Custom methods should not start with a '/'." | ||
| severity: error | ||
| given: "$.paths" | ||
| then: | ||
| field: "@key" | ||
| function: pattern | ||
| functionOptions: | ||
| notMatch: "/[^/]+/:[a-zA-Z]+$" | ||
|
|
||
| xgen-security-override: | ||
| description: "Security must not be set at resource or method level because it is set globally. Use @Unauthenticated annotation to set no security. https://go/openapi-unauthenticated-annotation" | ||
| severity: error | ||
|
|
@@ -248,20 +190,6 @@ overrides: | |
| - "*.yaml#/components/schemas/tokenFiltertrim" | ||
| rules: | ||
| xgen-schema-name-pascal-case: "off" | ||
| - files: | ||
| - "*.yaml#/components/schemas/charFiltermapping" | ||
| rules: | ||
| xgen-description: "off" | ||
| - files: | ||
| - "*.yaml#/components/schemas/IndexOptions" | ||
| - "*.yaml#/components/schemas/NetworkPermissionEntryStatus" | ||
| rules: | ||
| xgen-schema-properties-camel-case: "off" | ||
| - files: | ||
| - "*.yaml#/components/schemas/DataLakeStoreSettings/properties/provider" # dynamic field which can't be documented | ||
| - "*.yaml#/components/schemas/ClusterProviderSettings/properties/providerName" # dynamic field which can't be documented | ||
| rules: | ||
| xgen-description: "off" | ||
| - files: | ||
| - "**#/components/schemas/ApiError/properties/parameters" # see https://github.com/stoplightio/spectral/issues/2592 | ||
| rules: | ||
|
|
||
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.
Do we have a ticket for this? Or is it covered in one of the existing tickets?
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.
Created the ticket for the last rollout, and included this one there. Let me know how it sounds