Skip to content

SchwarzIT/api-linter-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Linting Service

SIT

Prerequisites / general idea

General idea behind this API implementation is to provide an API as a service based on the awesome spectral schema linter and it´s nodeJS based SDK.

Main Technologies

Spectral API Validation

The API is build on top of the @stoplight/spectral-core SDK for nodeJS to execute API validations that follow the "Open API Specification" pattern. Spectral itself is Open Source and able to validate any json or yaml defined schemas with dedicated rulesets, while playing it´s strengths definitely in validation of OpenAPI Specs.

Build / Setup the local dev env

First make sure to have installed the following OS dependencies for development:

Download all local development dependencies via (just for code completion, code will be executed in docker):

$ npm install

Build the Docker-Compose based local dev environment

$ docker-compose build --no-cache

Running the API in "debug" mode

Per default the API runs in "debug" mode during local development.

You should always start the API using Docker-Compose.

$ docker-compose build
$ docker-compose up (-d)

Running the API in "prod" mode

$ docker-compose -f docker-compose-prod-sim.yml build
$ docker-compose -f docker-compose-prod-sim.yml up (-d)

JS rules migration at application start up

The API downloads a dedicated spectral ruleset behind a configurable url as a base for further migration of this files into JavaScript. No need to redeploy the application after changing your spectral ruleset, restart is enough and you get served with your recently updated and published ruleset.

Without changing the download url the API uses SchwarzIT API Rules as default for API linting.

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

About

RESTful service to provide API linting as-a-service

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published