RESTful service to provide API linting as-a-service

Overview

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

Install the spectral-cli since it's needed in the pre-commit hook

$ npm install -g @stoplight/spectral-cli

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 up (-d)

Running the API in "prod" mode

$ docker-compose -f dcp.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
You might also like...

WPPConnect/WA-JS API SERVER is a small api server to provide url preview for @wppconnect/wa-js library

WPPConnect/WA-JS API SERVER WPPConnect/WA-JS API SERVER is a small api server to provide url preview for @wppconnect/wa-js library Our online channels

Aug 11, 2022

Code Scanning/SAST/Static Analysis/Linting using many tools/Scanners with One Report - Scanmycode Community Edition (CE)

Code Scanning/SAST/Static Analysis/Linting using many tools/Scanners with One Report - Scanmycode Community Edition (CE)

Star it If you like it, please give it a GitHub star/fork/contribute. This will ensure continous development ⭐ TLDR; To install it. Install docker and

Dec 29, 2022

Visual Studio Code extension for formatting and linting Django/Jinja HTML templates using djLint

Visual Studio Code extension for formatting and linting Django/Jinja HTML templates using djLint

Dec 15, 2022

The Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.

The Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.

The Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.

Jan 1, 2023

The Remix Stack for deploying to Fly with Supabase, authentication, testing, linting, formatting, etc.

The Remix Stack for deploying to Fly with Supabase, authentication, testing, linting, formatting, etc.

Remix Supa Fly Stack Learn more about Remix Stacks. npx create-remix --template rphlmr/supa-fly-stack What's in the stack Fly app deployment with Doc

Jan 7, 2023

The Remix Blog Stack for deploying to Fly with MDX, SQLite, testing, linting, formatting, etc.

The Remix Blog Stack for deploying to Fly with MDX, SQLite, testing, linting, formatting, etc.

Remix Speed Metal Stack Learn more about Remix Stacks. npx create-remix --template Girish21/speed-metal-stack Remix Blog 📖 This blog starter template

Jan 2, 2023

The Remix Stack for deploying to Fly with SQLite, authentication, testing, linting, formatting, etc.

The Remix Stack for deploying to Fly with SQLite, authentication, testing, linting, formatting, etc.

Remix Indie Stack Learn more about Remix Stacks. npx create-remix --template remix-run/indie-stack What's in the stack Fly app deployment with Docker

Dec 30, 2022

The Remix Stack for deploying to Fly with PostgreSQL, authentication, testing, linting, formatting, etc.

The Remix Stack for deploying to Fly with PostgreSQL, authentication, testing, linting, formatting, etc.

The Remix Stack for deploying to Fly with PostgreSQL, authentication, testing, linting, formatting, etc.

Jan 2, 2023

Remix Stack for deploying to Vercel with remix-auth, Planetscale, Radix UI, TailwindCSS, formatting, linting etc. Written in Typescript.

Remix Stack for deploying to Vercel with remix-auth, Planetscale, Radix UI, TailwindCSS, formatting, linting etc. Written in Typescript.

Remix Synthwave Stack Learn more about Remix Stacks. npx create-remix --template ilangorajagopal/synthwave-stack What's in the stack Vercel deploymen

Dec 25, 2022
Comments
  • Removed auth

    Removed auth

    Basic auth was removed from the openapi spec. It's prefered to handle authentication for the service using an other service in front of it, like a reverse proxy or api gateway.

    opened by markbrockhoff 2
  • Fix utf8 crash

    Fix utf8 crash

    • Fixed a bug where the linter would return an unexpected HTTP code 500 for specs using weird utf-8 characters
    • Updated all dependencies related to spectral to the newest version
    opened by markbrockhoff 1
  • Fix highest severity

    Fix highest severity

    • Fixed the property 'highestSeverity' of the response of lintings. Now it's always present, even if the highest severity is just e.g. warn.
    • Fixed the npm scripts for running tests so the service can be tested in e.g. watchmode
    • Updated the commited and migrated rules
    • Added the spectral-cli as a dev dependency and linked it to the pre-commit hook, so it does not have to be installed manually
    opened by markbrockhoff 0
Owner
Schwarz IT
Schwarz IT
The Remix Stack for deploying to Vercel with testing, linting, formatting, structure and mock for 3rd party API integration.

Remix DnB Stack See it live: https://dnb-stack.vercel.app/ Learn more about Remix Stacks. npx create-remix --template robipop22/dnb-stack What's in th

Robert Pop 61 Dec 13, 2022
A file sharing service, where you can upload files and provide a download link for anyone on the internet by sharing the link 🔗 or via mail ✉️ which remains active for 24hours 🕙.

eShare | File Sharing App A file sharing service, where you can upload files and provide a download link for anyone on the internet by sharing the lin

Akhil Bhalerao 7 Nov 20, 2022
RESTful API using Hapi NodeJs Framework. This app is project from Dicoding Couses, Belajar Membuat Aplikasi Back-end untuk Pemula

RESTful API using Hapi NodeJs Framework. This app is project from Dicoding Couses, Belajar Membuat Aplikasi Back-end untuk Pemula

Muhammad Ferdian Iqbal 1 Jan 3, 2022
MiniSense RESTful API

MiniSense RESTful API Why was it developed This project is part of an activity proposed by SenseUp aimed at approving a selection process for a Back-E

Alef Sena 1 Jan 21, 2022
🎵 simple and RESTful API for getting lyrics of any song made using Next.js and ChakraUI.

playground . guide . discord Overview Lyrist is a simple yet powerful RESTful API for getting lyrics of any song using song name and it's artist name.

ashish 21 Dec 17, 2022
A dockerized uptime monitoring RESTful API server that allows authenticated users to monitor URLs

A dockerized uptime monitoring RESTful API server that allows authenticated users to monitor URLs, and get detailed uptime reports about their availability, average response time, and total uptime/downtime.

Anas Hamed 2 Oct 7, 2022
Here's a RESTful API that interacts with a PostgreSQL database written in NodeJS with Typescript, RESTify, and Sequelize ORM.

Basic description REST (Representational State Transfer) is a standard architecture for building and communicating with web services, It typically man

Olabisi Oduola 2 Jan 14, 2022
Uptime monitoring RESTful API server that allows authenticated users to monitor URLs, and get detailed uptime reports about their availability, average response time, and total uptime/downtime.

Uptime Monitoring API Uptime monitoring RESTful API server that allows authenticated users to monitor URLs, and get detailed uptime reports about thei

Mohamed Magdi 2 Jun 14, 2022
A RESTful API for Bing wallpaper to use easy.

bing-wallpaper A RESTful API for Bing wallpaper to use easy. <img src="https://bingw.jasonzeng.dev/?w=800"/> Usage API Endpoint: https://bingw.jasonze

jasonzeng 31 Dec 15, 2022
A RESTful API to support online store.

?? Table of Contents About API Endpoint Get started Installation Running Building for production Running Tests Technology Contributors License ?? Abou

Zeyad Tarek 6 Dec 17, 2022