openapi-to-postman icon indicating copy to clipboard operation
openapi-to-postman copied to clipboard

Consistent IDs

Open jpoehnelt opened this issue 3 years ago • 8 comments

It would be beneficial to use consistent ids for the items in the collection instead of UUID. For example this would enable linking to a specific request. OpenAPI already supports operationId.

jpoehnelt avatar Aug 20 '21 18:08 jpoehnelt

@jpoehnelt Good suggestion! One thing I would like to ask though is, IDs are not persisted with import in Postman App. Meaning if you were to import this collection on postman app these IDs are not same (issue) So, can I know your use case with collections with id as operationId?

VShingala avatar Aug 23 '21 13:08 VShingala

My current setup is:

  1. construct OpenAPI spec from many files
  2. convert to postman collection
  3. use Postman API to patch collection in workspace

Step 3 ends up with a ton of noise in the Postman changelog, e.g. https://www.postman.com/google-maps-platform/workspace/047c6f75-6b23-42df-b77a-70d716895d9f/collection/13440387-fc4788d5-77f9-4639-a4c5-74a2878d7eb5?ctx=changelog, which I am assuming is due to changing ids.

jpoehnelt avatar Aug 26 '21 21:08 jpoehnelt

Here is my workaround doing a post processing of the conversion output. https://github.com/googlemaps/openapi-specification/pull/189

jpoehnelt avatar Aug 26 '21 23:08 jpoehnelt

Note the workaround did not work in the upload process (step 3 above). This is still desired.

jpoehnelt avatar Sep 09 '21 20:09 jpoehnelt

@jpoehnelt Here for step 3 - Patch collection, are you using this endpoint? If yes, here patching will overwrite entire collection. Meaning entire collection will be replaced and here even if we try to patch same collection with previous IDs, it will contain many changes.

VShingala avatar Sep 13 '21 09:09 VShingala

how should I update in that case?

jpoehnelt avatar Feb 04 '22 19:02 jpoehnelt

@VShingala Any updates here?

jpoehnelt avatar May 16 '22 20:05 jpoehnelt

@jpoehnelt For mentioned Update endpoint, there should be no problem with updating the collection generated from this module. (I tried it myself and did not see any issue, the collection was updated with all changes)

However, as I understand, the main issue you have right now is that IDs present in collection changes which result in additional changes (some changes replaces ID which are not necessary). Unfortunately, atm, as this module simply uses postman-collection to generate collection, IDs are generated by postman-collection APIs.

Although with all id fields or without id fields there should be no problem with updating collection via mentioned endpoint.

Do let me know if I am missing anything here.

VShingala avatar May 20 '22 09:05 VShingala

@jpoehnelt update endpoint should fix step 3 in your workflow. I am closing this ticket for now but feel free to reopen it if you are still blocked 🙇‍♂

akshaydeo avatar Feb 13 '23 08:02 akshaydeo