#openapi #gateway #api-gateway #api #hot-reloading

app openapi-gateway

API Gateway based on OpenAPI routes

4 releases

0.1.4 Feb 18, 2022
0.1.3 Feb 18, 2022
0.1.2 Feb 18, 2022
0.1.1 Feb 16, 2022
0.1.0 Feb 13, 2022

Custom license

5MB
503 lines

OpenAPI Gateway

API Gateway that build its routes via OpenAPI specification.

Hot reloading of OpenAPI files is supported with reload_cron (see Config).

This project simplifies orchestration of services that work with OpenAPI.

Config

# openapi-gateway-config.toml

# Refresh every minute
reload_cron = "* * * * *"

[[openapi_urls]]
name = "Swagger petstore example V2#JSON"
url = "https://petstore.swagger.io/v2/swagger.json"

[[openapi_urls]]
name = "Swagger petstore example V2#YAML"
url = "https://petstore.swagger.io/v2/swagger.yaml"

[[openapi_urls]]
name = "Swagger petstore example V3#JSON"
url = "https://petstore3.swagger.io/api/v3/openapi.json"

[[openapi_urls]]
name = "Swagger petstore example V3#YAML"
url = "https://petstore3.swagger.io/api/v3/openapi.yaml"

Start project

Cargo run

cargo run

Cargo install

cargo install openapi-gateway
openapi-gateway

After project setup

Open http://127.0.0.1:8080/docs/ to find the configured routes.

Open points

  • Metrics
  • Docker
  • Tags based inclusion/exclusion

Dependencies

~19–28MB
~552K SLoC