apideck-libraries / portman

Port OpenAPI Specs to Postman Collections, inject test suite and run via Newman 👨🏽‍🚀
http://getportman.com/
Apache License 2.0
632 stars 60 forks source link

Fake Values are set On Read-Only fields in the Open API spec. #628

Closed harajara closed 1 month ago

harajara commented 1 month ago

I have ran the postman collection via newman collection runner created by portman with the latest version fand found out it has a broken functionality.

The read only fields are not sent in the request earlier, but it is present with the recent release. Kindly address this issue.

Working Version: 1.28.0 Failed Version: 1.29.0

Request Body


  │             "tag_group_name": "in ull",
  │             "tag_name": "sin",

Error Reported

 ┌ ↓ text/plain ★ text ★ plain ★ utf8 ★ 226B
  │ request body has an error: doesn't match schema: readO
  │ nly property "tag_group_name" in request | readOnly pr
  │ operty "tag_name" in request | readOnly property "tag_
  │ group_name" in request | readOnly property "tag_name" 
  │ in request
  └
thim81 commented 1 month ago

hi @harajara

Thanks for reporting this. In version 1.29.0, we switched to convertV2 of the openapi-to-postman module, which has an open issue on handling read-only properties.

Could you share a minimal example of an OpenAPI with your read-only properties and the expected result of the Postman request body? We can use your case to investigate the issue and think of a fix.

Depending on our finding, we could contribute the fix to the openapi-to-postman module OR extend Portman to handle the read-only properties.

As a work-a-round for your case, we would suggest to use Portman 1.28.0, while we investigate the issue.

The v1.29.0 introduces a bug fix for the fuzzing feature and an improvement of the conversion for multiple request bodies, which sound like not relevant for your current case.

thim81 commented 1 month ago

Update: the openapi-to-postman has fix in review for this issue. As soon as this lands, we will update Portman to use the new version of openapi-to-postman.

thim81 commented 1 month ago

hi @harajara

We have a PR ready that handles the "readonly" properties back as before. See the PR for the details and an example.

harajara commented 1 month ago

Thanks @thim81. I have checked the PR https://github.com/apideck-libraries/portman/pull/634 and it looks nice. 😄 💯

thim81 commented 1 month ago

hi @harajara

We just released Portman 1.29.2, which contains the fix for the proper readonly handling.

This should skip the readonly properties from the generated request body.

We always appreciate input from the Portman users, so if you have more issue or improvements, please let us know.