Rajat Chouhan
07/13/2023, 8:26 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Rajat Chouhan
07/21/2023, 11:02 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Rajat Chouhan
07/21/2023, 12:04 PMMatt (pactflow.io / pact-js / pact-go)
Rajat Chouhan
07/24/2023, 8:35 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Slackbot
07/24/2023, 12:33 PMMatt (pactflow.io / pact-js / pact-go)
isRoot
property. There is hopefully a straightforward explanation for it, but it’s late and my brain isn’t working right now 😉Rajat Chouhan
07/26/2023, 7:59 AMMatt (pactflow.io / pact-js / pact-go)
Rajat Chouhan
07/27/2023, 6:49 AMMatt (pactflow.io / pact-js / pact-go)
Rajat Chouhan
07/27/2023, 1:09 PMRajat Chouhan
07/27/2023, 1:15 PMMatt (pactflow.io / pact-js / pact-go)
Rajat Chouhan
08/04/2023, 4:59 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
allOf
situation. We have some backlog items created to improve the experience, that we are reviewing in the next iteration.
You will be automatically contacted via support when those features are completed.Matt (pactflow.io / pact-js / pact-go)
oneOf
issues you’re having, have you looked at adding a discriminator
keyword: https://docs.pactflow.io/docs/bi-directional-contract-testing/contracts/oas/keyword-support/#the-discriminator-keyword?
That would help narrow the chances of a schema conflictAlex
08/28/2023, 12:47 PMAlex
08/28/2023, 12:51 PM"Request body is incompatible with the request body schema in the spec file: *must match exactly one schema* in oneOf
[root].interactions[7].request.body.data.attributes.configuration = {"binaryPointAlarmConfiguration":{"alarmValue":true}}"
Issue:
But our POST body DOES indeed match to only one schema listed in "oneOf" statement.
Only to the "BinaryPointAlarmConfiguration", as described in the above post.
Question:
Is that true, that the evaluation of pactflow.io does not perform as expected and that its a bug?Matt (pactflow.io / pact-js / pact-go)
Arpit Gawande
08/28/2023, 3:30 PMMatt (pactflow.io / pact-js / pact-go)
payload.json
with the correct context (i.e. the pact you have generated, stripped down to the failing interaction only)Matt (pactflow.io / pact-js / pact-go)
additionalProperties
failure:
AlarmConfigurationAttributesGET:
type: object
required:
- createdAt
- lastUpdatedAt
- message
- category
- enabled
- configuration
properties:
configuration:
# type: object # <- uncomment this and it fails
oneOf:
- $ref: "#/components/schemas/AnalogPointAlarmConfiguration"
- $ref: "#/components/schemas/BinaryPointAlarmConfiguration"
- $ref: "#/components/schemas/MultiStatePointAlarmConfiguration"
createdAt:
type: string
format: "date-time"
lastUpdatedAt:
type: string
format: "date-time"
message:
type: string
category:
type: string
enabled:
type: boolean
This might be a bug, either in PactFlow, ajv (the schema validator we use) or just a misunderstanding of how type: object
works.Matt (pactflow.io / pact-js / pact-go)
npx @pactflow/swagger-mock-validator@latest test-swagger.yaml payload.json
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Rajat Chouhan
08/30/2023, 4:14 AMRajat Chouhan
08/30/2023, 5:39 AMadditionalProperties
failure and that existing 'oneOf' schema match issue. Should we raise separate ticket for additional property failure issue?Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
AlarmConfigurationAttributesUpdate:
type: object
properties:
configuration:
#type: object <--------- 👋 this needs to be removed
additionalProperties: true
oneOf:
- $ref: "#/components/schemas/AnalogPointAlarmConfiguration"
- $ref: "#/components/schemas/BinaryPointAlarmConfiguration"
- $ref: "#/components/schemas/MultiStatePointAlarmConfiguration"
Matt (pactflow.io / pact-js / pact-go)
type: object
where the `oneOf`s exist, this passesMatt (pactflow.io / pact-js / pact-go)
Rajat Chouhan
08/30/2023, 8:24 AMMatt (pactflow.io / pact-js / pact-go)
Rajat Chouhan
08/30/2023, 9:39 AMMatt (pactflow.io / pact-js / pact-go)
npx @pactflow/swagger-mock-validator@latest <path to oas> <path to pact file>
Rajat Chouhan
08/31/2023, 7:27 AMMatt (pactflow.io / pact-js / pact-go)
Rajat Chouhan
08/31/2023, 8:39 AMJordan Nazemi
08/31/2023, 6:47 PMallOf
workaround your support team provided Rajat? Facing a similar issue in our implementationMatt (pactflow.io / pact-js / pact-go)
oneOf
, drop the type: object
bit. I’m still figuring out why this works.
AlarmConfigurationAttributesUpdate:
type: object
properties:
configuration:
#type: object <--------- 👋 this needs to be removed
additionalProperties: true
oneOf:
- $ref: "#/components/schemas/AnalogPointAlarmConfiguration"
- $ref: "#/components/schemas/BinaryPointAlarmConfiguration"
- $ref: "#/components/schemas/MultiStatePointAlarmConfiguration"
Matt (pactflow.io / pact-js / pact-go)
Rajat Chouhan
09/01/2023, 5:05 AMAnkush Hasani
01/10/2024, 12:13 PMMatt (pactflow.io / pact-js / pact-go)
Rajat Chouhan
01/25/2024, 4:57 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)