Multi-artifacts: Secondary artifact not adding examples #1259
-
I have uploaded via UI an OpenAPI yaml file to mock an API. This works ok, but since the response data is very large, the API contract does not contains examples. Just metadata, info, paths and schemas. After this, I've uploaded a Postman collection for the same API which contains some saved samples for different scenarios. But the Postman samples are not reflected on the 'operations' section on the UI. I can only see 'commodities' response (coming from the OpenAPI file) but not the samples included via Postman collection. What is the expectation about this? Should I see more response tabs / options available after adding the secondary artifact? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
Hi Juani,
Can you see the collection on the APIs services properties? You should have
your openAPI and you collection in contracts.
If not, then check:
https://microcks.io/documentation/explanations/multi-artifacts/
«
The merging process is based on a compound key: the API *name* + *version*.
If not explicitly identified as primary or secondary, the default is to
consider an imported artifact as the primary one. Microcks will simply
ignore a secondaryartifact if it doesn’t match any existing API name +
version. »
Regards,
Yacine
Le mar. 6 août 2024 à 14:10, Juani Nicolai ***@***.***> a
écrit :
… I have uploaded via UI an OpenAPI yaml file to mock an API. This works ok,
but since the response data is very large, the API contract does not
contains examples. Just metadata, info, paths and schemas.
After this, I've uploaded a Postman collection for the same API which
contains some saved samples for different scenarios.
From the server logs I can see the postman collection gets successfully
added as secondary artifact (I am checking that box on the upload modal)
and I can see it in the microcks API Details.
But the Postman samples are not reflected on the 'operations' section on
the UI.
Does this mean that if the primary artifact (open api) does not contain
response samples it's not possible to add more examples when adding a
secondary artifact? I came to this conclusion since I cannot see any error
logs or warning from UI / server logs.
—
Reply to this email directly, view it on GitHub
<#1259>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEG4TRC7437W74L6TEQTJ3ZQC4LTAVCNFSM6AAAAABMCGILIKVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXGAYTOOJZHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
You can have a look at this OpenAPI file: https://github.com/microcks/api-lifecycle/blob/master/contract-testing-demo/apipastries-openapi.yaml
and the corresponding Postman Collection that add 1 example on the
GET /pastry/{name}
operation: https://github.com/microcks/api-lifecycle/blob/master/contract-testing-demo/apipastries-postman-collection.json.The matching is done thanks to line 102 where
/pastry/:name
(+ verb on line 99) is matched with the line 77 in OpenAPI + verb on line 79.Hope it helps,