-
Notifications
You must be signed in to change notification settings - Fork 14
CLOUDP 329998: IPA package configuration #846
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 9 commits
16fd814
38adc80
3d7b02d
7da82f7
9dbd288
7737688
b2b18be
ef72079
91768fc
49d94fd
70aad57
7f901f4
bfdbc75
26feaf5
2b33e74
f2f07b0
da5ac20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules | ||
sphterry marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,20 @@ | |
|
||
The IPA validation uses [Spectral](https://docs.stoplight.io/docs/spectral/9ffa04e052cc1-spectral-cli) to validate the [MongoDB Atlas Admin API OpenAPI Specification](https://github.com/mongodb/openapi/tree/main/openapi). The rules cover MongoDB's [Improvement Proposal for APIs](https://mongodb.github.io/ipa/) (IPA), which are best-practices for API design. | ||
|
||
|
||
## Quick Links | ||
|
||
| Site | Link | | ||
| --------------------------- | -------------------------------------------------------------------------------------------------------- | | ||
| MongoDB API Standards (IPA) | [https://mongodb.github.io/ipa/](https://mongodb.github.io/ipa/) | | ||
| Installation & Usage | [IPA README](https://github.com/mongodb/openapi/tree/main/tools/spectral/ipa#readme) | | ||
| Implemented Rules | [Ruleset Documentation](https://github.com/mongodb/openapi/tree/main/tools/spectral/ipa/rulesets#readme) | | ||
| Spectral Docs | [Spectral](https://docs.stoplight.io/docs/spectral/674b27b261c3c-overview) | | ||
| Spectral Wiki (Internal) | [http://go/openapi-spectral-updates](http://go/openapi-spectral-updates) | | ||
|
||
| Contributing | [CONTRIBUTING.md](https://github.com/mongodb/openapi/blob/main/tools/spectral/CONTRIBUTING.md) | | ||
| Changelog | [CHANGELOG.md](https://github.com/mongodb/openapi/blob/main/tools/spectral/CHANGELOG.md) | | ||
| Issues | [https://github.com/mongodb/openapi/issues](https://github.com/mongodb/openapi/issues) | | ||
|
||
## Running Locally | ||
|
||
### Prerequisites | ||
|
@@ -19,12 +33,6 @@ npm run ipa-validation | |
|
||
This command will run Spectral CLI for the ruleset [ipa-spectral.yaml](https://github.com/mongodb/openapi/blob/main/tools/spectral/ipa/ipa-spectral.yaml) on the raw [v2.yaml](https://github.com/mongodb/openapi/blob/main/openapi/.raw/v2.yaml) OpenAPI spec. | ||
|
||
The Spectral CLI can also be used to run the validation on any valid OpenAPI file (`json` or `yaml`). | ||
|
||
``` | ||
spectral lint {path/to/oas/file} --ruleset=./tools/spectral/ipa/ipa-spectral.yaml | ||
``` | ||
|
||
## Integrating IPA Validations | ||
|
||
To incorporate the IPA Spectral ruleset for OpenAPI specification validation in your repositories, you can follow these implementation approaches: | ||
|
@@ -40,9 +48,17 @@ extends: | |
- https://raw.githubusercontent.com/mongodb/openapi/<latest-git-commit-sha>/tools/spectral/ipa/ipa-spectral.yaml | ||
``` | ||
|
||
#### Package-based Installation | ||
#### Package-based Installation (**TO BE RELEASED**) | ||
lovisaberggren marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Run: | ||
``` | ||
npm install @mongodb-js/ipa-validation-ruleset | ||
``` | ||
|
||
Not supported yet | ||
Then reference the ruleset directly in your `.spectral.yaml` file: | ||
``` | ||
extends: | ||
- "@mongodb-js/ipa-validation-ruleset" | ||
``` | ||
|
||
### Integration Methods | ||
|
||
|
@@ -55,6 +71,13 @@ extends: | |
- https://raw.githubusercontent.com/mongodb/openapi/<latest-git-commit-sha>/tools/spectral/ipa/ipa-spectral.yaml | ||
``` | ||
|
||
or | ||
|
||
``` | ||
extends: | ||
- "@mongodb/ipa-validation-ruleset" | ||
``` | ||
|
||
For more information about how to extend rulesets, see the [web page](https://meta.stoplight.io/docs/spectral/83527ef2dd8c0-extending-rulesets). | ||
|
||
#### Customization Options | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
Important: Set one of the package version -1 . post merge we can validate dependabot updates.
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.
When should I do this? Now or post merge?