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

Sostituzione di "Validate" con "Check" #707

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/non-breaking.yml

This file was deleted.

14 changes: 7 additions & 7 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# APIs validator compliant to the Italian Interoperability Framework
# APIs checker compliant to the Italian Interoperability Framework

[![Join the #api channel](https://img.shields.io/badge/Slack-%23api-blue.svg?logo=slack)](https://developersitalia.slack.com/messages/CDKBYTG74)
[![API on forum.italia.it](https://img.shields.io/badge/Forum-interoperabilit%C3%A0-blue.svg)](https://forum.italia.it/c/piano-triennale/interoperabilita)

This repository contains an in-browser validator that verifies some of the rules for the REST APIs, as indicated in the Interoperability Model.
This repository contains an in-browser checker that verifies some of the rules for the REST APIs, as indicated in the Interoperability Model.

The associated projects are indicated in the [API Starter Kit](https://github.com/teamdigitale/api-starter-kit).
There's a Beta [github-action that uses these rules](https://github.com/teamdigitale/api-oas-checker-action).

The ready-to-use online application is available [here](https://teamdigitale.github.io/api-oas-checker).

The validator is based on [Spectral](https://github.com/stoplightio/spectral).
The checker is based on [Spectral](https://github.com/stoplightio/spectral).

We preferred it because
it does not require databases or server components to process your OpenAPI documents (OAS Checker is a github pages static application),
and because the vast majority of ruleset can be described via static files (e.g. YAML):
[except for very specific cases](security/functions/) you don't need to execute javascript code.
Moreover, uses that do not trust sourcing javascript code, can just limit themself to static rules.

Other good validators we evaluated are:
Other good checkers we evaluated are:

- [Zally](https://github.com/zalando/zally) requires a database and cannot be webpackaged in a browser application;
- [Speccy](https://github.com/wework/speccy) seem to support only javascript rules, while our rules are usually described using static YAML files.
Expand All @@ -42,7 +42,7 @@ $ spectral lint -r https://italia.github.io/api-oas-checker/spectral.yml $OAS_UR

## CI Mode (versioned rulesets)

When embedding the validator in a CI, you may want to use a specific version of the rules instead of the latest one.
When embedding the checker in a CI, you may want to use a specific version of the rules instead of the latest one.
version of the rules instead of the latest one. In this case, you can refer to
tags prefixed with `rules/X.Y.Z` (e.g. `rules/0.3.3`).

Expand All @@ -53,7 +53,7 @@ $ spectral lint -r https://raw.githubusercontent.com/italia/api-oas-checker/rule
## IDE mode

Some IDEs support Spectral via extensions.
Here are the steps to use the complete validation profile
Here are the steps to use the complete checking profile
with [the official Spectral extension for Visual Studio Code](https://github.com/stoplightio/vscode-spectral):

```bash
Expand Down Expand Up @@ -137,7 +137,7 @@ that the spectral output corresponds to that indicated in the associated `.snaps
./test-ruleset.sh rules problem
```

Therefore, when editing a rule, it is necessary to recreate and validate the contents of the snapshot
Therefore, when editing a rule, it is necessary to recreate and check the contents of the snapshot
with

```bash
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Validatore per API conformi al Modello di Interoperabilità
# Checker per API conformi al Modello di Interoperabilità

[![Join the #api channel](https://img.shields.io/badge/Slack-%23api-blue.svg?logo=slack)](https://developersitalia.slack.com/messages/CDKBYTG74)
[![API on forum.italia.it](https://img.shields.io/badge/Forum-interoperabilit%C3%A0-blue.svg)](https://forum.italia.it/c/piano-triennale/interoperabilita)
[![README in English](https://img.shields.io/badge/Readme-English-darkgreen.svg)](README.en.md)

💡 Questo repository contiene un validatore in-browser che verifica alcune delle regole per le API REST indicate nel Modello di Interoperabilità.
💡 Questo repository contiene un checker in-browser che verifica alcune delle regole per le API REST indicate nel Modello di Interoperabilità.

🗂️ I progetti associati sono indicati nell'[API Starter Kit](https://github.com/teamdigitale/api-starter-kit).

👨🏻‍💻 L'applicazione on-line pronta all'uso è disponibile [qui](https://italia.github.io/api-oas-checker/).

⚙️ Il validatore è basato su [Spectral](https://github.com/stoplightio/spectral).
⚙️ Il checker è basato su [Spectral](https://github.com/stoplightio/spectral).

> ### Perché Spectral? 🤔
> Lo abbiamo preferito rispetto ad altri software perché
Expand All @@ -19,7 +19,7 @@ non richiede l'utilizzo di database o componenti server a cui inviare i tuoi doc
>
> Le alternative valutate, ugualmente valide, sono:
> - [Zally](https://github.com/zalando/zally) ha bisogno di un database e non è possibile farne un webpackage;
> - [Speccy](https://github.com/wework/speccy) pare supportare solo regole in JavaScript, mentre questo validatore utilizza per lo più dei file YAML statici.
> - [Speccy](https://github.com/wework/speccy) pare supportare solo regole in JavaScript, mentre questo checker utilizza per lo più dei file YAML statici.

## 📦 Contenuto

Expand All @@ -33,11 +33,11 @@ non richiede l'utilizzo di database o componenti server a cui inviare i tuoi doc

La gestione delle regole è esterna: la cartella `rules-modi` punta, infatti, al repo [api-oas-checker-rules](https://github.com/italia/api-oas-checker-rules).

## 🔍 Validare le API
## 🔍 Eseguire il check delle API

Il modo più semplice per controllare un'API è di utilizzare la versione web di questo validatore, inserendo il contenuto dell'API e selezionando un set di regole. Sarà, quindi, possibile esaminare tutti gli errori, warning, info e hint rilevati da Spectral.
Il modo più semplice per controllare un'API è di utilizzare la versione web di questo checker, inserendo il contenuto dell'API e selezionando un set di regole. Sarà, quindi, possibile esaminare tutti gli errori, warning, info e hint rilevati da Spectral.

In alternativa, è possibile validare le API tramite IDE, CLI e GitHub Action: si rimanda al seguente [README](https://github.com/italia/api-oas-checker-rules/blob/main/README.md) del repo [api-oas-checker-rules](https://github.com/italia/api-oas-checker-rules) per tutte le informazioni.
In alternativa, è possibile fare il check delle API tramite IDE, CLI e GitHub Action: si rimanda al seguente [README](https://github.com/italia/api-oas-checker-rules/blob/main/README.md) del repo [api-oas-checker-rules](https://github.com/italia/api-oas-checker-rules) per tutte le informazioni.

## 🚀 Avviare la web app in locale

Expand Down Expand Up @@ -69,7 +69,7 @@ Questo comando testa le regole presenti nel file `problem.yml` contenuto nella d
./test-ruleset.sh rules-modi/rules problem
```

Quando si modifica una regola, è necessario ricreare e validare il contenuto della snapshot con:
Quando si modifica una regola, è necessario ricreare e rifare il check del contenuto della snapshot con:

```bash
./test-ruleset.sh rules-modi/rules --snapshot problem
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@
"start": "make rules && webpack serve",
"test": "jest"
},
"version": "0.5.2"
"version": "0.6"
}
4 changes: 2 additions & 2 deletions public/initial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# the one based on the Italian Guidelines (default)
# the one with some basic Security checks.

# Paste here your OAS spec and click on "Validate"
# Paste here your OAS spec and click on "Check"
# or download them from the internet and click on "From url"
# then fix them directly in the editor.

Expand All @@ -12,5 +12,5 @@
# quello basato sul Modello d'Interoperabilità di AgID (default)
# e quello che include una serie preliminare di controlli di sicurezza.
#
# Incolla qui le tue specifiche OpenAPI e clicca su "Validate"
# Incolla qui le tue specifiche OpenAPI e clicca su "Check"
# oppure scaricale cliccando su "From url" e correggile direttamente nell'editor
4 changes: 2 additions & 2 deletions src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ export const Header = () => {
<div data-testid="right-section" className={rightSection}>
<img className="d-none d-md-block ml-4 mr-2" src="it.svg" alt="it logo" />
<img className="d-none d-md-block mx-2" src="loghetto.svg" alt="checker logo" />
<span className="m-0 font-weight-semibold">Italian OpenAPI Validation Checker</span>
<span className="m-0 font-weight-semibold">Italian OpenAPI Checker</span>
<span href="#" className={classes.version}>
{/* eslint-disable-next-line no-undef */}
Beta {VERSION}
{VERSION}
</span>
{/* eslint-disable-next-line no-undef */}
<a className={classes.anchor} href={REPO_URL}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ValidationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ ${event.data.error}`);
tag="button"
onClick={validationInProgress ? Function.prototype : handleValidation}
>
{validationInProgress ? 'Please wait...' : 'Validate'}
{validationInProgress ? 'Please wait...' : 'Check'}
<Icon className={classes.validatorIcon} color="white" icon="it-refresh" />
</Button>
</div>
Expand Down
Loading