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:
- Language Commands - Ready-to-use generation commands for all supported languages
- Advanced Configuration - Custom templates, automation, and enterprise features
- Usage Examples - See generated clients in action with practical examples
- Reference Guide - Troubleshooting, best practices, and complete documentation
๐ 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.