We use swagger2openapi module to first convert Swagger 2.0 document to OpenAPI v3 and then use OpenAPI-to-Postman module for conversion.
In this flow, when there are YAML anchors used in Swagger document. swagger2openapi module throws the following exception for the attached file in issue.
S2OError: YAML anchor or merge key at #/paths/~1client/post/produces
at throwError (/Users/vishal/swagger2-postman2/node_modules/swagger2openapi/index.js:39:15)
at /Users/vishal/swagger2-postman2/node_modules/swagger2openapi/index.js:1369:21
at recurse (/Users/vishal/swagger2-postman2/node_modules/reftools/lib/recurse.js:38:13)
at recurse (/Users/vishal/swagger2-postman2/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/vishal/swagger2-postman2/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/vishal/swagger2-postman2/node_modules/reftools/lib/recurse.js:53:13)
Fix:
Upon deep dive into swagger2openapi module, we found that we have to specifically specify option to enable anchor cloning while using API provided by module. Here is reference.
Enabling this option solves the corresponding issue.
RCA:
We use swagger2openapi module to first convert Swagger 2.0 document to OpenAPI v3 and then use OpenAPI-to-Postman module for conversion.
In this flow, when there are YAML anchors used in Swagger document. swagger2openapi module throws the following exception for the attached file in issue.
Fix:
Upon deep dive into swagger2openapi module, we found that we have to specifically specify option to enable anchor cloning while using API provided by module. Here is reference.
Enabling this option solves the corresponding issue.