-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ibm-requestbody-name): turn rule off by default, is now redundant (…
…#673) Now that the IBM API Handbook provides firm and robust guidance on schema naming and we validate for this guidance in 'ibm-schema-naming-convention', requiring the 'x-codegen-request-body-name' to be specified on relevant schemas is no longer necessary. It is resulting in APIs having to duplicate names between the schema name, title, and extension. This rule will remain in place for teams that wish to use it but this commit turns it off by default. https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-schemas#naming Signed-off-by: Dustin Popp <[email protected]>
- Loading branch information
Showing
7 changed files
with
26 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...eset/src/rules/requestbody-name-exists.js → ...ges/ruleset/src/rules/requestbody-name.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
/** | ||
* Copyright 2017 - 2023 IBM Corporation. | ||
* Copyright 2017 - 2024 IBM Corporation. | ||
* SPDX-License-Identifier: Apache2.0 | ||
*/ | ||
|
||
const { | ||
operations, | ||
} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); | ||
const { oas3 } = require('@stoplight/spectral-formats'); | ||
const { requestBodyNameExists } = require('../functions'); | ||
const { requestBodyName } = require('../functions'); | ||
|
||
module.exports = { | ||
description: | ||
'Verifies that operations have the x-codegen-request-body-name extension set when needed', | ||
message: '{{error}}', | ||
given: operations, | ||
severity: 'warn', | ||
severity: 'off', | ||
formats: [oas3], | ||
resolved: true, | ||
then: { | ||
function: requestBodyNameExists, | ||
function: requestBodyName, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters