This page documents Dense Analysis recommendations for connecting APIs together and how microservices in general ought to be bridged together.

Principles

  1. You should never write REST client code by hand: generate it!
  2. Swagger specs are obsolete: use OpenAPI specs.
  3. Always write async/concurrent code: write for the future!

How to make REST Calls

This section lists the best ways to make REST API request calls from code in different languages.

OpenAPI

Use the Dense Analysis down converter for OpenAPI specs where you only have 3.0 spec support. (This doesn’t exist yet, and we will be converting https://github.com/apiture/openapi-down-convert/blob/main/src/converter.ts to Go code with unit tests and copyright attribution.)

How to Export and OpenAPI specs

  1. Use CD rules to generate specs from code and publish them
  2. Publish in OpenAPI 3.0 as JSON with Dense Analysis down-converter
  3. Publish in OpenAPI 3.1 spec as JSON also which may not suffer from down-conversion bugs
  4. git commit and use generated spec files and the generated code in other repos