From 5fb1f7040dcf29bfd74073cf175f2c3758192070 Mon Sep 17 00:00:00 2001 From: Rafal Artych <121048129+rartych@users.noreply.github.com> Date: Thu, 28 Sep 2023 08:21:51 +0200 Subject: [PATCH 01/15] Add files via upload --- documentation/Linting-rules.md | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 documentation/Linting-rules.md diff --git a/documentation/Linting-rules.md b/documentation/Linting-rules.md new file mode 100644 index 00000000..cd068fca --- /dev/null +++ b/documentation/Linting-rules.md @@ -0,0 +1,63 @@ +# CAMARA API Linting Rules Documentation + +## Introduction + + +## 1. Spectral core ruleset + +Spectral has a built-in OpenAPI Specification ruleset that can be used to validate OpenAPI files. + +With `extends: "spectral:oas"` ("oas" being shorthand for OpenAPI Specification) in the ruleset file to rules for OpenAPI v2 and v3.x, depending on the appropriate OpenAPI version being used (this is automatically detected through formats) are added to the final ruleset. + +The full list of the rules in this ruleset are described in [OpenAPI Rules](https://docs.stoplight.io/docs/spectral/4dec24461f3af-open-api-rules). + + +`extends: [[spectral:oas, off]]` - this avoids running any rules from the extended ruleset as they are disabled. Each rule can [enabled individually](https://docs.stoplight.io/docs/spectral/0a73453054745-recommended-or-all#enabling-rules). + +### OpenAPI v2 & v3 +Rules applying to both OpenAPI v2.0, v3.0, and most likely v3.1. + + +|Name| Desc| Recommended|CAMARA use| +|---|---|---|--| +|contact-properties| contact object is full of the most useful properties: `name`, `url`, `and email`|No|No | +|duplicated-entry-in-enum| Each value of an `enum` must be different from one another |Yes | Yes | +|info-contact |Info object should contain `contact` object |Yes | Yes| + + + + + + + + +## 2. Language + +### Spell checking + +CAMARA API specification files include inline documentation. + +The description attributes should be checked for typos. + +_Spectral rule_: [camara-language-spelling]() + + +### Reduce telco-specific terminology in API definitions + +API Design Guidelines: [2.5 Reduce telco-specific terminology in API definitions](https://github.com/camaraproject/Commonalities/blob/main/documentation/API-design-guidelines.md#25-reduce-telco-specific-terminology-in-api-definitions) + +Consider and account for how the API can be fulfilled on a range of network types. +Avoid terms/types specific to a given telco domain - terms should be inclusive beyond mobile network. + +See also [CAMARA Glossary](https://github.com/camaraproject/Commonalities/blob/main/documentation/Glossary.md) + + +| ❌   Not recommended | 👍   Recommended | +|----------------------------|-------------------------| +| `UE` | `device` | +| `MSISDN` | `phone number` | +| `mobile network` | `network` | + + +_Spectral rule_: [camara-language-avoid-telco]() + From c141ae254651d122e892d67a24ec4fce366e655e Mon Sep 17 00:00:00 2001 From: Rafal Artych <121048129+rartych@users.noreply.github.com> Date: Thu, 28 Sep 2023 08:25:43 +0200 Subject: [PATCH 02/15] Create README.md --- artifacts/Github_actions/.workflows/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 artifacts/Github_actions/.workflows/README.md diff --git a/artifacts/Github_actions/.workflows/README.md b/artifacts/Github_actions/.workflows/README.md new file mode 100644 index 00000000..b172552b --- /dev/null +++ b/artifacts/Github_actions/.workflows/README.md @@ -0,0 +1 @@ +Configuration files for Github Actions From f38bd84245f5cc7b019c2119cda51163db04bb3f Mon Sep 17 00:00:00 2001 From: Rafal Artych <121048129+rartych@users.noreply.github.com> Date: Tue, 3 Oct 2023 22:51:41 +0200 Subject: [PATCH 03/15] Update Linting-rules.md --- documentation/Linting-rules.md | 80 +++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 11 deletions(-) diff --git a/documentation/Linting-rules.md b/documentation/Linting-rules.md index cd068fca..ba15be7f 100644 --- a/documentation/Linting-rules.md +++ b/documentation/Linting-rules.md @@ -18,21 +18,51 @@ The full list of the rules in this ruleset are described in [OpenAPI Rules](http Rules applying to both OpenAPI v2.0, v3.0, and most likely v3.1. -|Name| Desc| Recommended|CAMARA use| -|---|---|---|--| -|contact-properties| contact object is full of the most useful properties: `name`, `url`, `and email`|No|No | -|duplicated-entry-in-enum| Each value of an `enum` must be different from one another |Yes | Yes | -|info-contact |Info object should contain `contact` object |Yes | Yes| - - - - - +|Name| Desc| Recom mended|CAMARA use|Spectral level | CAMARA Level +|---|---|---|--|---|--| +|contact-properties| contact object is full of the most useful properties: `name`, `url`, `and email`|No|No | | | +|duplicated-entry-in-enum| Each value of an `enum` must be different from one another |Yes | Yes | | | +|info-contact |Info object should contain `contact` object |Yes | Yes| | | +|info-description |Info object should contain `description` object |Yes | Yes| | | +|info-license |Info object should contain `license` object |Yes | Yes| | | +|license-url | link to the full text of licence | Yes | Yes| | | +|no-$ref-siblings| Before OpenAPI v3.1, keywords next to $ref were ignored | Yes | Yes| | | +|no-eval-in-markdown | injecting `eval()` JavaScript statements could lead to an XSS attack |Yes |Yes | | | +|no-script-tags-in-markdown | injecting `