Initial commit
This commit is contained in:
85
skills/skill-adapter/assets/contract_template.json
Normal file
85
skills/skill-adapter/assets/contract_template.json
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"_comment": "Pact contract template. Customize this to match your API's structure.",
|
||||
"provider": {
|
||||
"name": "YourProviderAPI"
|
||||
},
|
||||
"consumer": {
|
||||
"name": "YourConsumer"
|
||||
},
|
||||
"interactions": [
|
||||
{
|
||||
"_comment": "Example interaction. Modify as needed.",
|
||||
"description": "A request for a user",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"path": "/users/123",
|
||||
"headers": {
|
||||
"Accept": "application/json"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json; charset=utf-8"
|
||||
},
|
||||
"body": {
|
||||
"id": 123,
|
||||
"name": "John Doe",
|
||||
"email": "john.doe@example.com",
|
||||
"address": {
|
||||
"street": "123 Main St",
|
||||
"city": "Anytown",
|
||||
"zip": "12345"
|
||||
},
|
||||
"_comment": "You can use Pact matchers here, e.g., using a regex to validate email format.",
|
||||
"email_verification_status": "verified"
|
||||
}
|
||||
},
|
||||
"providerStates": [
|
||||
{
|
||||
"name": "User 123 exists",
|
||||
"params": {
|
||||
"user_id": 123
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"_comment": "Another example interaction - creating a new user.",
|
||||
"description": "Creating a new user",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"path": "/users",
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"body": {
|
||||
"name": "Jane Smith",
|
||||
"email": "jane.smith@example.com"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": 201,
|
||||
"headers": {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Location": "/users/456"
|
||||
},
|
||||
"body": {
|
||||
"id": 456,
|
||||
"name": "Jane Smith",
|
||||
"email": "jane.smith@example.com"
|
||||
}
|
||||
},
|
||||
"providerStates": [
|
||||
{
|
||||
"name": "The user service is available"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"pactSpecification": {
|
||||
"version": "3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user