postmanlabs / openapi-to-postman

Plugin for converting OpenAPI 3.0 specs to the Postman Collection (v2) format
Apache License 2.0
928 stars 200 forks source link

Fixed an issue where schemas under allOf keyword having additionalProperties set to false were not generating bodies correctly. #787

Closed VShingala closed 8 months ago

VShingala commented 8 months ago

Overview

Issue reported by user: https://github.com/postmanlabs/openapi-to-postman/issues/417#issuecomment-2018756292

RCA

Issue was with merging schemas under allOf, specifically having additionalProperties: false. Third-party library (https://github.com/mokkabonna/json-schema-merge-allof) used for this purpose was defaulting to resolving no properties in such case leaving the resolved schema body empty.

Fix

We'll be using suggested option ignoreAdditionalProperties as true in such cases. This makes sure that we're keeping request data from schemas underlying allOf keywords correctly instead of considering additionalProperties in one of schema.

See more about this option here: https://github.com/mokkabonna/json-schema-merge-allof?tab=readme-ov-file#options