Wayne Ng
06/17/2022, 7:49 PMResponse body is incompatible with the response body schema in the spec file: should NOT have additional properties - id
Mismatched Pact Path:
[root].interactions[0].response.body.paymentMethods[0]
Mismatched Provider Path:
[root].paths./userprofile/v1/paymentmethods.get.responses.200.content.application/json.schema.properties.paymentMethods.items.additionalProperties
In our provider contract, if we follow the provider path, items can be anyOf
, as seen below
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
paymentMethods:
type: array
items:
anyOf:
- $ref: '#/components/schemas/creditCard'
- $ref: '#/components/schemas/bankAccount'
schemas:
creditCard:
type: object
properties:
id:
type: integer
userId:
type: integer
externalId:
type: string
type:
type: string
lastFour:
type: string
isPrimary:
type: boolean
issuer:
type: string
verificationStatus:
type: string
expiration:
type: object
properties:
year:
type: integer
month:
type: integer
We're wondering why the contract comparison can't find the schema definition? paymentMethods[0]
is matching the credit card schema currently in our consumer contract
As an aside, should BDCT questions be in #C5F4KFKR8 or #CLS16AVEE (since it's currently just a pactflow feature)?Yousaf Nabi (pactflow.io)
Wayne Ng
06/17/2022, 9:29 PMbankAccount:
type: object
properties:
id:
type: integer
userId:
type: integer
externalId:
type: string
type:
type: string
lastFour:
type: string
isPrimary:
type: boolean
issuer:
type: string
verificationStatus:
type: string
Since Pact does not support those key words then, I assume we just don't want to contract test those use cases then? Or is there another route we should go?
I think a separate BDCT channel would be super helpful since it is a big feature and the documentation is still limitedWayne Ng
06/17/2022, 9:30 PMYousaf Nabi (pactflow.io)
Matt (pactflow.io / pact-js / pact-go)
anyOf
and oneOf
operators. Unlike the allOf
which I think is more problematic (albeit we could modify the behaviour to suit the standard use case), I think the validation behaviour is clearerMatt (pactflow.io / pact-js / pact-go)
Wayne Ng
06/27/2022, 3:46 PMMatt (pactflow.io / pact-js / pact-go)
Chris Williams
07/04/2022, 2:50 PMallOf
in, is there any update or sense of timescale for this being reviewed? Thanks 🙂Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
allOf
and published the tweaked OASChris Williams
07/05/2022, 10:50 AMjson-schema-merge-allof
solution I think, and accept that the OAS file we push to the broker isn’t quite the originalMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Chris Williams
07/05/2022, 11:00 AMChris Williams
07/05/2022, 4:32 PMChris Williams
07/05/2022, 4:33 PM$ref
the spec file jumped from a 506K yaml, to a 695K JSON, to a 2.8MB de-$ref’ed / de-allOf’ed monsterChris Williams
07/06/2022, 8:11 AM