-
-
Notifications
You must be signed in to change notification settings - Fork 780
request body in openapi no need to append the components #2069
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -648,3 +648,18 @@ def test_cookie_param(simple_app): | |
| response = app_client.get("/v1.0/test-cookie-param") | ||
| assert response.status_code == 200 | ||
| assert response.json() == {"cookie_value": "hello"} | ||
|
|
||
|
|
||
| def test_openapi_schema_validate_with_request_body_change(simple_app): | ||
| app_client = simple_app.test_client() | ||
|
|
||
| if simple_app._spec_file == "openapi.yaml": | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you please help me understand the need for this
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One more comment, if you can please have patience with me. I see there is a test file |
||
| response = app_client.post( | ||
| "/v1.0/test-default-object-body", | ||
| headers={"content-type": "application/json"}, | ||
| json={"image_version": "2015-08-26"}, | ||
| ) | ||
| assert response.status_code == 200 | ||
|
|
||
| response = app_client.get("/v1.0/openapi.json") | ||
| assert response.status_code == 200 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize that only the init method has pydoc for parameters, the rest of the methods have basically none. With that said, since you are introducing a new parameter with a default value, I think it would be really helpful to add a little pydoc section with a sentence about the new parameter. Please consider it. I'd like to suggest that text, but I am still trying to understand exactly what is being appended here (or not).