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

Error while resolving allof schema: very confusing #417

Closed
steve-nay-sage opened this issue Oct 8, 2021 · 8 comments · Fixed by #778
Closed

Error while resolving allof schema: very confusing #417

steve-nay-sage opened this issue Oct 8, 2021 · 8 comments · Fixed by #778
Assignees
Labels
bug Something isn't working importer schema-object Concerning schema object of OpenAPI spec.

Comments

@steve-nay-sage
Copy link

I've attached a fair-sized OAS file. (I had to change the file extension from .yaml to .txt or GitHub wouldn't accept it.) When I try this command on it:

openapi2postmanv2 -p -s ap.openapi.yaml -o test.postman_collection.json -O requestParametersResolution=Example,folderStrategy=Tags

It creates a Postman collection but gives this error:

Error while resolving allOf schema:  Error: Could not resolve values for path:"properties.key.type". They are probably incompatible. Values:
"string"
"object"

I've tracked it down to the key property at line 2801 in the file, where if I add type: string then I don't get the error. However, there should be no reason to add that because the first object listed in the allOf already sets the type of that property to string. There are several other identical structures in the OAS file that do not cause the same error.

To make things even more confusing, if I leave off either of the options at the end of the command, the error doesn't show up. So I can use requestParametersResolution=Example without seeing the error OR I can use folderStategy=Tags without seeing the error, but I can't use them both. That implies that there is nothing at all wrong with my OAS file, but some very odd problem that shows up when those two options are used together.

It's beyond my skillset to debug further than that. I can point out the problem pretty specifically, but I can't dig into the code to find the source. I appreciate anyone who can look at this.

ap.openapi.txt
.

@VShingala VShingala added bug Something isn't working schema-object Concerning schema object of OpenAPI spec. labels Jan 13, 2023
@VShingala
Copy link
Member

@steve-nay-sage Thanks for reporting the issue and apologies for the late reply. It seems the third party module used for resolving allOf keyword/schemas is failing in this case. We'll take a detailed look and address this in the upcoming weeks.

@Ifropc
Copy link

Ifropc commented May 12, 2023

Hi @VShingala , any updates on this issue? In postmanlabs/postman-app-support#11656 it says that this issue has been resolved.
However, when running openapi-to-postmanv2 4.12.0 on this file I'm getting the error

Error while resolving allOf schema:  Error: Could not resolve values for path:"enum". They are probably incompatible. Values:
<...> 

ReDoc and Swagger edditor renders this yaml correctly
You can see this issue for details

@VShingala
Copy link
Member

Reopening since closed after related PR merge. Will close manually once it's included in release.

@VShingala VShingala reopened this Jan 12, 2024
@VShingala
Copy link
Member

VShingala commented Feb 12, 2024

@steve-nay-sage @Ifropc We've fixed this issue with the latest Postman app v10.22. I've confirmed both of your mentioned files are imported correctly. Feel free to reopen the issue in case you face any further related problem with it.

@redquis
Copy link

redquis commented Mar 25, 2024

Hi @VShingala, I am still experiencing an issue with an OAS json file (generated via NSwag) that is using allOf inside request and response objects. I don't actually get an error when using the command openapi2postmanv2 -p -s specification.json -o test.postman_collection.json I just get the message Conversion successful, collection written to file. But the body object in Postman for the POST method is an empty object {}

specification.txt
test.postman_collection.json.txt

@VShingala
Copy link
Member

@redquis Thanks for reporting the issue! We're working on fix for it and it should be available in couple days. I'll update here once it gets released.

@VShingala
Copy link
Member

@redquis This issue is now fixed with latest version v4.1.0 of openapi-to-postmanv2 module. It'll also gets fixed in postman app with upcoming releases.

@redquis
Copy link

redquis commented Mar 27, 2024

Thank you @VShingala, I can confirm that it works for me using v4.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working importer schema-object Concerning schema object of OpenAPI spec.
Projects
None yet
5 participants