Skip to content

Commit

Permalink
Update OpenAPI version to 3.1.0 and fix test for Spain's June weather
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredodeza committed Oct 22, 2024
1 parent e7b4c26 commit 79551b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion webapp/.well-known/openapi.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"openapi": "3.0.2", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": {"/": {"get": {"summary": "Root", "description": "Allows to open the API documentation in the browser directly instead of\nrequiring to open the /docs path.", "operationId": "root__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/countries": {"get": {"summary": "Countries", "operationId": "countries_countries_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/countries/{country}": {"get": {"summary": "Cities", "operationId": "cities_countries__country__get", "parameters": [{"required": true, "schema": {"title": "Country", "type": "string"}, "name": "country", "in": "path"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/countries/{country}/{city}/{month}": {"get": {"summary": "Monthly Average", "operationId": "monthly_average_countries__country___city___month__get", "parameters": [{"required": true, "schema": {"title": "Country", "type": "string"}, "name": "country", "in": "path"}, {"required": true, "schema": {"title": "City", "type": "string"}, "name": "city", "in": "path"}, {"required": true, "schema": {"title": "Month", "type": "string"}, "name": "month", "in": "path"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}}, "components": {"schemas": {"HTTPValidationError": {"title": "HTTPValidationError", "type": "object", "properties": {"detail": {"title": "Detail", "type": "array", "items": {"$ref": "#/components/schemas/ValidationError"}}}}, "ValidationError": {"title": "ValidationError", "required": ["loc", "msg", "type"], "type": "object", "properties": {"loc": {"title": "Location", "type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}}, "msg": {"title": "Message", "type": "string"}, "type": {"title": "Error Type", "type": "string"}}}}}}
{"openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": {"/": {"get": {"summary": "Root", "description": "Allows to open the API documentation in the browser directly instead of\nrequiring to open the /docs path.", "operationId": "root__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/countries": {"get": {"summary": "Countries", "operationId": "countries_countries_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/countries/{country}/{city}/{month}": {"get": {"summary": "Monthly Average", "operationId": "monthly_average_countries__country___city___month__get", "parameters": [{"name": "country", "in": "path", "required": true, "schema": {"type": "string", "title": "Country"}}, {"name": "city", "in": "path", "required": true, "schema": {"type": "string", "title": "City"}}, {"name": "month", "in": "path", "required": true, "schema": {"type": "string", "title": "Month"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}}, "components": {"schemas": {"HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}}}}
4 changes: 2 additions & 2 deletions webapp/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ def test_spain_june():
response = client.get("/countries/Spain/Seville/June")
assert response.status_code == 200
assert response.json() == {
"high": 33,
"low": 19,
"high": 93,
"low": 63,
}

0 comments on commit 79551b0

Please sign in to comment.