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

Fix: makes sure that the operationObject is an object. #821

Closed
wants to merge 1 commit into from

Conversation

CodeLionA88
Copy link

Description

For reasons unbeknown to me, probably related to changes in the standard, the parser gets tripped up at this type of structure

"openapi":"3.1.0",
"paths":{
"openapi":{
"0":"3","1":".","2":"0","3":".","4":"2"

}

It ends up trying to add a description to a string. Then errors out.

Motivation and Context

I made the bold assumtion that the opperations made on the variable named "operationObject" where ment to be object related opperations. So a small check for an object fixed my build issues.

How Has This Been Tested?

I have not made any attempt to run the test scripts as i was unable to resolve the dependency tree.

npm ERR! While resolving: demo@2.1.3 npm ERR! Found: react@18.2.0 npm ERR! node_modules/react npm ERR! react@"^18.2.0" from demo@2.1.3 npm ERR! demo npm ERR! demo@2.1.3 npm ERR! node_modules/demo npm ERR! workspace demo from the root project npm ERR!

However as i mentioned this change fixed my build, and has for me been without issue.
Do with this what you will, it might be that I'm the idiot - but seeing as it parsed fine in redoc I thought I'd create the issue.

Have a good day.

@sserrata
Copy link
Member

Hi @CodeLionA88, thanks for the PR, can you share a copy of your OpenAPI spec so we can reproduce?

Copy link

Visit the preview URL for this PR (updated for commit 3c1afbf):

https://docusaurus-openapi-36b86--pr821-icm0a3md.web.app

(expires Thu, 13 Jun 2024 14:45:15 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@CodeLionA88
Copy link
Author

CodeLionA88 commented May 14, 2024

@sserrata

{ "openapi": "3.1.0", "info": { "title": "My API", "version": "0.0.1" }, "paths": { "openapi": { "0": "3", "1": ".", "2": "0", "3": ".", "4": "2" }, "security": { "0": { "sessionToken": [] } }, "info": { "license": { "url": "https://opensource.org/license/mit", "name": "MIT" }, "title": "My API", "version": "0.0.1" }, "servers": { "0": { "url": "/api/v1" } } } }

This is a snippet example of the part of the spec that first caused the issue.

Then again, it might be caused by my yaml to json serializer making arrays into dictionaries. Doesn't seem like a thing that should happen. You tell me.

I have not given the situation much thought ;S

@CodeLionA88
Copy link
Author

Got some time on my hands and checked properly, It's most definitly my serializer doing spaced up junk. closing the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants