Hi Team, I have been trying out the Bidirectional ...
# pactflow
s
Hi Team, I have been trying out the Bidirectional contract testing feature and sort of hit a blocker with the below error. I do have the path defined in the provider spec in the location it's complaining. Any leads on how to go about debugging this would be of great help. Thanks
m
can you please show the OAS that you’re comparing to?
s
Please find below the spec. I have renamed/ updated some fields. Thanks
{
"swagger": "2.0",
"x-authapikey": true,
"info": {
"description": "get points",
"version": "1.0",
"title": "app apis",
"license": {
"name": "test"
}
},
"basePath": "/tester/test/v1",
"schemes": [
"https"
],
"paths": {
"/data/accounts/points": {
"get": {
"tags": [
"test"
],
"summary": "Get points balance",
"description": "Get points balance",
"operationId": "getPoints",
"x-servers": [
{
"url": "",
"description": "test"
}
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "header",
"name": "token",
"description": "User Token",
"type": "string",
"required": true
},
{
"in": "header",
"name": "sub-key",
"description": "subscription key",
"type": "string",
"required": true
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "object",
"properties": {
"Customer": {
"type": "object",
"properties": {
"FirstName": {
"type": "string"
},
"PointsBal": {
"type": "integer"
}
}
}
}
}
}
}
}
}
}
}
m
thx, can you please also share the pact file?
s
Here is the consumer contract. Thanks
{
"consumer": {
"name": "MyPointsConsumer"
},
"interactions": [
{
"description": "a request for checking my points balance",
"providerState": "I want to check my points balance",
"request": {
"headers": {
"sub-key": "somekey",
"token": "sometoken"
},
"method": "GET",
"path": "/data/accounts/points"
},
"response": {
"body": [
{
"Customer": {
"FirstName": "SUMANTA",
"PointsBalance": 99354,
}
}
],
"headers": {
"Content-Type": "application/json"
},
"status": 200
}
}
],
"metadata": {
"pact-js": {
"version": "10.1.2"
},
"pactRust": {
"ffi": "0.3.9",
"models": "0.4.5"
},
"pactSpecification": {
"version": "2.0.0"
}
},
"provider": {
"name": "MyPointsProvider"
}
}
👍 1
m
OK I can reproduce. Upgrading to OAS3 seems to address this, is that an option for you?
If not, we might need you to raise a support case for us to look into
s
Thanks Matt. We have most of our specs available in Swagger 2.0 at the moment. Could you please help with how I can raise a support case ? Thanks
m
No probs. Please send a ticket to support@pactflow.io and attach the info in this thread (the OAS, the Pact file and the screenshot/problem). Also make a note that I have requested you to raise the issue, so it will be routed to the dev team. Appreciate you doing this, and sorry for the issues. I can’t see why it would be causing issues so need to dive deeper.
s
Great. Thanks for your help
👍 1