Skip to content

Is openapi_core compatible with falcon 3.0.0? #311

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

Closed
igorkaplan opened this issue Apr 8, 2021 · 2 comments · Fixed by #316
Closed

Is openapi_core compatible with falcon 3.0.0? #311

igorkaplan opened this issue Apr 8, 2021 · 2 comments · Fixed by #316
Labels
area/contrib Indicates an issue on contrib area.

Comments

@igorkaplan
Copy link

I am getting the error while using openapi_core with falcon as middleware. All requests without body give error code 400 and following error message:
{'title': 'Invalid JSON', 'description': 'Could not parse an empty JSON body'}
Looks like fixing the following code fixes this error:
https://github.com/p1c2u/openapi-core/blob/master/openapi_core/contrib/falcon/requests.py#26
body = (
dumps(request.json) if getattr(request, "json", None)

  •        else dumps(request.media)                                                                                    
    
  •        else dumps(request.get_media({}))
    
@Stargateur
Copy link

Stargateur commented Apr 10, 2021

personally with curl --request GET 'localhost:8000/' I get:

{
    "title": "415 Unsupported Media Type",
    "description": "text/plain is an unsupported media type."
}

On a route that doesn't take any body.

@p1c2u p1c2u added the area/contrib Indicates an issue on contrib area. label Apr 16, 2021
@p1c2u
Copy link
Collaborator

p1c2u commented Apr 16, 2021

Falcon integration is compatible with falcon 2.x

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

Successfully merging a pull request may close this issue.

3 participants