Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
harajara opened this issue Aug 7, 2024 · 5 comments
Closed

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

harajara opened this issue Aug 7, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@harajara
Copy link

harajara commented Aug 7, 2024

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
Copy link
Collaborator

thim81 commented Aug 7, 2024

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 thim81 self-assigned this Aug 7, 2024
@thim81 thim81 added the bug Something isn't working label Aug 7, 2024
@thim81
Copy link
Collaborator

thim81 commented Aug 7, 2024

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
Copy link
Collaborator

thim81 commented Aug 18, 2024

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
Copy link
Author

Thanks @thim81. I have checked the PR #634 and it looks nice. 😄 💯

@thim81
Copy link
Collaborator

thim81 commented Aug 19, 2024

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.

@thim81 thim81 closed this as completed Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants