Closed eurog33k closed 1 month ago
Hi @eurog33k
We look into the cause of this, which we can try to reproduce thanks to your clear explanation and files. It could be that the filter action results in a incorrect YAML structure. We will keep you posted of our findings.
hi @eurog33k
The issue lies with the empty oneOf:
The filtering mechanisme cleans up "empty" objects. In case of anyOf or oneOf; the empty objects are valid so they should be kept.
This will be fixed in the next release of Portman.
As a work-around, you can already keep the "empty" objects by adding "preserveEmptyObjects": true
in your filters.
filter.json >>
{
"methods": ["POST","DELETE"],
"tags": [],
"operationIds": [],
"operations": [],
"flags": [],
"flagValues": [],
"preserveEmptyObjects": true
}
You can see the filtered result in the online playground
FYI: Thanks to your example we also spotted a unwanted removal of the "delete" property, which will also be fixed in the next Portman version.
hi @eurog33k
We just released Portman 1.29.2, which contains the fixes for the reported YAML error.
Thanks for reporting the issue and helping us to improve Portman.
I can confirm that the update fixes the problem. I'm glad my report helped the project.
I'm issuing the following command: portman -l ./time.json -o ./outcoll.json --filterFile ./filter.json
My portman version is 1.29.1 on MacOS 13.6.7
I'm getting the following:
I'm attaching my openapi 3 file and my filter file time.json filter.json
I haven't been able to figure out why the filter doesn't work.
If I issue the command without the filter (portman -l ./time.json -o ./outcoll.json), the outcoll.json Postman collection gets generated correctly.
I'm unable to get the filter to work.