Skip to content

Client Generation Overview โ€‹

Generate API clients in any language from our OpenAPI 3.1.1 specification. This guide covers everything you need to create production-ready clients for the cyber.trackr.live API.

New to the API? Start with our API Getting Started Guide to understand the endpoints and data model before generating a client.

๐ŸŽฏ Why Generate Clients? โ€‹

Benefits of Generated Clients:

  • ๐ŸŽฏ Type Safety - Compile-time error checking
  • ๐Ÿ”„ Always Up-to-Date - Generated from latest specification
  • ๐Ÿ“š Comprehensive Coverage - All endpoints and models included
  • ๐Ÿงช Consistent Testing - Same patterns across all languages
  • ๐Ÿš€ Quick Integration - Install and use immediately

๐Ÿ”ง OpenAPI Generator โ€‹

We use OpenAPI Generator - the industry-standard tool for generating API clients from OpenAPI specifications.

Installation โ€‹

bash
# Option 1: Docker (Recommended)
docker pull openapitools/openapi-generator-cli

# Option 2: NPM
npm install -g @openapitools/openapi-generator-cli

# Option 3: Homebrew (macOS)
brew install openapi-generator

# Option 4: Download JAR
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.2.0/openapi-generator-cli-7.2.0.jar

Basic Usage โ€‹

bash
# Generate client using Docker
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
  -i https://raw.githubusercontent.com/mitre/cyber-trackr-live/main/openapi/openapi.yaml \
  -g <generator-name> \
  -o /local/generated-client

# Generate client using NPM
openapi-generator-cli generate \
  -i https://raw.githubusercontent.com/mitre/cyber-trackr-live/main/openapi/openapi.yaml \
  -g <generator-name> \
  -o ./generated-client

๐Ÿ“š Next Steps โ€‹

Ready to generate your first client? Choose your path:

๐Ÿš€ Quick Start โ€‹

For the impatient, here's a one-liner to generate a Ruby client:

bash
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
  -i https://raw.githubusercontent.com/mitre/cyber-trackr-live/main/openapi/openapi.yaml \
  -g ruby --library=faraday \
  --additional-properties=gemName=my_cyber_client,gemVersion=1.0.0 \
  -o /local/my-ruby-client

More languages and detailed configuration available in Language Commands.

Released under the Apache-2.0 License.