Generated Service Result Data Model
Defines the data structure returned after generating a new API service. Includes service and version IDs, configuration details, and any contract warnings.
Overview
The GeneratedServiceResult is a data structure that represents the successful outcome of a service generation operation. When a new service is created on the platform, this object is returned to the caller, providing a comprehensive summary of the newly created resources and their configuration.
It serves as a receipt, containing all the necessary identifiers (serviceId, versionId), configuration details (backendEndpointUrl, environment), and a list of generated operations. It also includes a mechanism for reporting non-blocking warnings related to contract validation, allowing service creation to succeed even if minor issues are detected.
How It Works
The GeneratedServiceResult is an immutable record that acts as a data transfer object (DTO). It is constructed and returned by the administrative service responsible for generating new API services.
A key feature is the handling of contract validation issues. During service generation, a "round-trip harness" may test field mappings. If it finds that a field's example value does not conform to its own contract (e.g., a regex pattern), it generates a non-blocking warning.
IMPORTANT
The presence of contractWarnings does not indicate a failure. The service and its associated workspace are still created successfully. However, it signals that the API publisher should review and manually correct the flagged field mappings to ensure correct behavior.
The contractWarnings field will be null if all validations pass. If it is populated, it contains structured details about each finding.
Field Reference
The GeneratedServiceResult object contains the following fields:
| Field Name | Type | Description |
|---|---|---|
serviceId | UUID | The unique identifier for the newly created service. |
versionId | UUID | The unique identifier for the initial version of the service. |
serviceKey | String | A unique, human-readable key for the service. |
serviceName | String | The display name of the service. |
environment | String | The environment where the service was created. |
backendProfileId | UUID | The unique identifier of the backend profile associated with this service. |
backendEndpointUrl | String | The URL of the backend endpoint for this service. |
backendAutoConfigured | boolean | A flag indicating whether the backend was configured automatically as part of the generation process. |
operations | List<GeneratedOperationRecord> | A list of records detailing each operation generated for the service. |
contractWarnings | Map<String, Object> | A map containing details of non-blocking contract validation warnings, or null if no warnings were found. |
contractWarnings Structure
When contractWarnings is not null, it contains structured information about findings from the contract validation process. The source defines the map's structure as follows:
| Key | Type | Description |
|---|---|---|
code | String | The warning code, which is S2R-ADM-0612 for this type of finding. |
warningCount | Integer | The total number of individual warnings found. |
message | String | A summary message for the warnings. |
warnings | Array | An array of objects, where each object details a specific warning. The source does not specify the structure of these individual warning objects. |
Troubleshooting
S2R-ADM-0612 Contract Warnings
Condition: The contractWarnings field in the response is populated.
Cause: During service generation, the platform's round-trip validation harness detected that one or more fields' example values did not satisfy their own defined contracts (e.g., a string example not matching a specified regex pattern).
Resolution: This is a non-blocking warning. The service has been created successfully. The API publisher should review the contents of the contractWarnings object to identify the specific fields with issues. After identifying them, the publisher must manually correct the field mappings in the service configuration to ensure the contract is fully satisfied.
See Also
GeneratedOperationRecord: The data model for individual operations within a generated service.
