Skip to content
Open
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
1 change: 0 additions & 1 deletion .spectral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,3 @@ rules:
- required: [ format ]
- required: [ pattern ]
severity: warn

29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,28 +393,33 @@ Please see the separate [Dev environment](https://tools.hmcts.net/confluence/dis

This repo contains overrides for the default dev environment configuration, controlled by PR labels.

## OpenAPI Specification and Data Schema Validation
### Supported labels

| Label | Usages |
|------------------------|--------------------------------------------------------------------------------------------------|
| enable_darts_portal | Deploys a DARTS portal instance alongside the API in the dev environment |
| enable_darts_fullstack | Not yet supported, but will deploy the full DARTS stack alongside the API in the dev environment |

This repository uses spectral to validate OpenAPI specifications. To install spectral, you can use npm or yarn:
## OpenAPI Validation

https://docs.stoplight.io/docs/spectral/b8391e051b7d8-installation
The application uses OpenAPI validation to ensure that incoming requests and outgoing responses conform to the OpenAPI specification. To install the IBM OpenAPI
validator, you can use npm or yarn:

https://github.com/IBM/openapi-validator?tab=readme-ov-file#installation

To validate the OpenAPI specification:
To enable OpenAPI validation, the following properties are set in the application configuration:

```bash
spectral lint --verbose "src/main/resources/openapi/**/*.{yml,yaml}"
lint-openapi "src/main/resources/openapi/**/*.yaml"
```

Documentation: https://stoplight.io/open-source/spectral
For more information on OpenAPI validation with IBM openapi validator, see the [openapi validator](https://github.com/IBM/openapi-validator).

Validate the data payload JSON Schemas:
This OpenAPI validation uses spectral ruleset to validate. To install spectral, you can use npm or yarn:

### Supported labels
https://docs.stoplight.io/docs/spectral/b8391e051b7d8-installation

| Label | Usages |
|------------------------|--------------------------------------------------------------------------------------------------|
| enable_darts_portal | Deploys a DARTS portal instance alongside the API in the dev environment |
| enable_darts_fullstack | Not yet supported, but will deploy the full DARTS stack alongside the API in the dev environment |
Documentation: https://stoplight.io/open-source/spectral

## License

Expand Down
5 changes: 5 additions & 0 deletions lint-openapi-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
errorsOnly: false
limits:
warnings: 100
outputFormat: 'json'
summaryOnly: true