Pavlo Sprogis
04/19/2022, 10:31 AMswagger.json
I have the field with "format" : "S2S-Token"
(this is our custom token) and pactflow fails with during verification:
Validator Error unknown format "S2S-Token" is used in schema at path "#/properties/value"
even though I have required headers and payload in request, looks like pactflow does not like this custom format field, is there a way to fix this?Matt (pactflow.io / pact-js / pact-go)
Yousaf Nabi (pactflow.io)
format
property have an associated primitive type
?
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#data-typesYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Matt (pactflow.io / pact-js / pact-go)
Pavlo Sprogis
04/19/2022, 11:39 AMCan you share your OAS?I will ask the team and management, since we have plenty of regulations, soc compliance, etc. That’s why I removed information about all endpoints and left only 1 for testing
Pavlo Sprogis
04/19/2022, 11:39 AMHey @Pavlo Sprogis, does youryes, it is string:property have an associated primitiveformat
?type
Pavlo Sprogis
04/19/2022, 11:40 AM}
Matt (pactflow.io / pact-js / pact-go)
Pavlo Sprogis
04/19/2022, 12:07 PMPavlo Sprogis
04/19/2022, 12:10 PMPavlo Sprogis
04/19/2022, 12:12 PMassuming you are using oas2yes, correct,
"swagger" : "2.0",
Yousaf Nabi (pactflow.io)
openapi: 3.0.3
will upload an example on a PR to view and testPavlo Sprogis
04/19/2022, 12:14 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Craig Schwarzwald
04/19/2022, 10:39 PMCraig Schwarzwald
04/19/2022, 10:42 PMYousaf Nabi (pactflow.io)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
anyOf
, oneOf
etc.)Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
additionalProperties=false should be added to any/every object that doesn’t already have an additionalProperties value specified. It makes sense for OAS to default that value to true, but for this compare tool specifically, it makes sense for that value to default to false.In the context of our BDCT feature, I’m not convinced that tool should do that or if Pactflow should pre-validate it. I could definitely see it having a flag however that controls the behaviour
Craig Schwarzwald
04/20/2022, 2:35 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
additionalProperties
and others will need adressing. As we move beyond OAS, the formula will also matureCraig Schwarzwald
04/20/2022, 2:49 AMadditional properties=false
will do a strict compare, but specifying that in the actual OAS may not be what you want all the time (and teams may forget or not know to). It sounds like you have a good direction on this.
It's exciting to see two of the biggest issues I've been having with pact-swagger compares for over a year get some traction toward resolutions.Matt (pactflow.io / pact-js / pact-go)
additionalProperties
more quickly than the other. But we definitely need to solve bothMatt (pactflow.io / pact-js / pact-go)
Yousaf Nabi (pactflow.io)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Yousaf Nabi (pactflow.io)
Matt (pactflow.io / pact-js / pact-go)
additionalProperties
to false during verification (the package above also now has an additional flag to conditionally set this if required)Yousaf Nabi (pactflow.io)
Pavlo Sprogis
05/17/2022, 9:58 AM