API First: From Zero to Hero (Part 2)

Importing an API into API Gateway

Provisioning the API gateway

make -k run-integration-tests
  • We created a shared network that will be used by Kong and its database (Postgres), the backend of our API (prism) and the client of our API (newman)
  • Provisioned the postgres database used by Kong
  • We provisioned Kong using database
  • We cleaned-up by removing the created containers and the network, this is because we want them to live only during the test execution

Provisioning the API backend (prism)

docker rm --force prism
make -k run-integration-tests

Importing the API

Adding the registry as insecure (Optional — self-generated certificates)

{
"insecure-registries" : [ "registry.domain.com" ]
}
systemctl restart docker

Pulling the swagger-to-kong image:latest

docker pull registry.domain.com/ci-tools/swagger-to-kong:latest
  • Import the openapi petstore-v3.0.yaml definition
  • Changes the address of the item servers in openapi with the value of the environment variable OPENAPI_SERVER, which in turn points to the backend (Mock). This setting is applied in Service Kong.
  • Invokes the kong Admin API to create the appropriate Service and Route.

Executing the collection via Makefile

make -k run-integration-tests

--

--

--

Cloud Specialists providing professional services with DevOps, BigData, Cloud Native Applications and Security. https://www.3bit.com.br/3bit

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Implementation of Top Design Patterns in Python

Introducing the Zapier Fundamentals Course

10 Important Python Questions You Should Know

Docker and Kubernetes: A Quick Summary

Employee Central & Platform updates in the 1H SF Release 2021

Getting started with .NET Code First and Migrations, Step by Step guide

Journal 19 — Modular Powerups, Unity Practice

☁️ Why decentralisation is key to breaking AWS and Microsoft’s cloud market monopoly 🕸️ — CUDOS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
3Bit Technologies

3Bit Technologies

Cloud Specialists providing professional services with DevOps, BigData, Cloud Native Applications and Security. https://www.3bit.com.br/3bit

More from Medium

How to update Appsettings.json based on deployment environment using yaml.

ASP.NET Core Web APIs with AWS Lambda

OCI REST APIs from Postman

Git/GitLab, How to upload your first project