External Tool Dto
OpenFrame Documentation
Get the most out of OpenFrame · Book 30 minutes with Conrad, 25 years in IT. He'll show you what Mingo and Fae can take off your list.
OpenFrame Documentation
External Tool Dto provides the small, JSON-deserializable response models used by the OpenFrame test service when it reads tool connection details from the External API. The models are supplied by the com.openframe.oss:openframe-test-service-core library and are generated from the External API OpenAPI contract exposed at GET /api-docs, version 1.1.0.
The module represents three complementary configuration facets:
All three classes use Jackson's ignore-unknown-properties behavior. This gives test clients forward-compatible deserialization when the API adds response fields, while retaining the fields that current test assertions use.
flowchart LR
ExternalApi["External API tool endpoint"] -->|"JSON response"| Jackson["Jackson deserialization"]
Jackson --> Credentials["Tool Credentials Response"]
Jackson --> Endpoint["Tool Url Response"]
Credentials --> ApiKey["Tool API Key Response"]
TestService["OpenFrame test service"] -->|"uses"| Credentials
TestService -->|"uses"| Endpoint
The models are boundary contracts rather than services: they do not perform authentication, network requests, secret storage, or validation. Those responsibilities remain with the caller and the External API. In particular, the presence of password and key fields means callers should treat populated instances as sensitive data and avoid serializing them to test output or logs.
| Component | Responsibility | JSON shape |
|---|---|---|
ToolApiKeyResponse |
Represents a tool API-key configuration. | key, type, keyName |
ToolCredentialsResponse |
Carries username/password credentials and an optional nested API-key representation. | username, password, apiKey |
ToolUrlResponse |
Carries a tool endpoint configuration. | url, port, type |
classDiagram
class ToolCredentialsResponse {
String username
String password
ToolApiKeyResponse apiKey
}
class ToolApiKeyResponse {
String key
String type
String keyName
}
class ToolUrlResponse {
String url
String port
String type
}
ToolCredentialsResponse --> ToolApiKeyResponse : contains
ToolApiKeyResponse is the nested API-key contract. Its fields preserve the key material and its descriptive metadata:
key is the API-key value returned for the tool configuration.type identifies the API-key category or authentication scheme as supplied by the API.keyName holds the key's name.The class uses Lombok @Data, @Builder, no-argument, and all-argument constructor annotations. Consequently, test code can either deserialize JSON or construct expected values through a builder.
ToolCredentialsResponse aggregates username/password authentication and ToolApiKeyResponse. The nested object lets a response express API-key configuration alongside basic credential fields without flattening or duplicating key metadata.
Its JSON tolerance is important for contract tests: fields introduced by newer API versions do not prevent existing test clients from reading recognized credentials fields. Tolerance does not imply validation; tests that need to assert required credentials should explicitly inspect the fields relevant to their scenario.
ToolUrlResponse provides the connection target for a tool:
url is the endpoint address.port is represented as a string by the generated contract.type identifies the endpoint or connection type returned by the API.Consumers should preserve the contract's string representation of port unless a specific test needs numeric interpretation. Parsing and connection behavior are intentionally outside this DTO.
sequenceDiagram
participant Test as "Test client"
participant API as "External API"
participant Mapper as "Jackson mapper"
participant DTO as "External Tool Dto"
Test->>API: Request tool configuration
API->>Test: Return JSON response
Test->>Mapper: Deserialize response body
Mapper->>DTO: Populate recognized fields
DTO-->>Test: Response object for assertions
Note over Mapper,DTO: Unknown JSON fields are ignored
@JsonIgnoreProperties(ignoreUnknown = true).password and key as secrets in diagnostics and fixtures. Mask them before emitting assertion failures or logs.Although this repository assembles and runs the test-service artifact, the implementation documented here is maintained in the OpenFrame OSS Library at com.openframe.oss:openframe-test-service-core. The source links in the component table point to the library revision from which these DTOs are supplied.