This directory contains generated API models for both Java and TypeScript, created from the OpenAPI specification.
api-models/
├── java/ # Java models (Maven project)
│ ├── pom.xml # Maven configuration
│ └── README.md # Java-specific documentation
├── typescript/ # TypeScript models (npm project)
│ ├── package.json # npm configuration
│ ├── src/ # Source code
│ └── README.md # TypeScript-specific documentation
└── README.md # This file
The models are automatically published to GitHub Packages when:
-
Push to main branch with changes to:
api-models/**filesschemas/**files (including guardrails schemas)- Workflow files
-
Manual trigger via GitHub Actions with custom API version
.github/workflows/publish-api-models.yml- Publishes Java and/or TypeScript models with configurable options.github/workflows/validate-api-models.yml- Validates configurations and model generation (runs on PRs and pushes to main)
To manually trigger publishing:
- Go to the GitHub repository
- Navigate to Actions tab
- Select Publish API Models workflow
- Click Run workflow
- Configure the options:
- version: API specification version (e.g.,
v1,v2) - publish_java: Whether to publish Java models (default: true)
- publish_typescript: Whether to publish TypeScript models (default: true)
- version: API specification version (e.g.,
- Click Run workflow
- Group ID:
com.trustification - Artifact ID:
evalguard-api-model - Repository:
https://maven.pkg.github.com/trustification/evalguard
- Package:
@trustification/evalguard-api-model - Registry:
https://npm.pkg.github.com
The project includes automatic validation that runs on every PR and push to main:
- Configuration validation: Checks that all required files exist and are valid
- Model generation: Tests that both Java and TypeScript models can be generated
- Tools validation: Validates the tools configuration using the existing validate command
- Guardrails validation: Validates guardrail configurations and cross-references
- make generate validation: Ensures
make generatedoesn't create unintended files or modify configuration files - Generated files validation: Ensures that the generation process produces the expected files
# Validate configurations and generate models
cd api-models/java && mvn validate
cd ../typescript && npm run validate
# Validate tools configuration
cd ../../tools && npm run build && node dist/index.js validate
# Validate make generate doesn't create unintended files
cd ../../tools && make validate-generate version=v1cd api-models/java
mvn clean generate-sources compile -Dapi.version=v1cd api-models/typescript
npm install
npm run generate -- --version v1
npm run build<dependency>
<groupId>com.trustification</groupId>
<artifactId>evalguard-api-model</artifactId>
<version>1.0.0</version>
</dependency>npm install @trustification/evalguard-api-modelimport { Task, Report } from '@trustification/evalguard-api-model';The API models support multiple API specification versions:
- v1: Current stable API
- v2: Future API versions (when available)
The version is specified during generation and publishing, allowing multiple API versions to coexist.