Skip to content

Commit

Permalink
Merge branch 'master' into feature-api-update-planner
Browse files Browse the repository at this point in the history
  • Loading branch information
elegantmoose authored Aug 16, 2024
2 parents 2b982bc + b93877d commit 41eb7b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ jobs:
stale-pr-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'
exempt-issue-labels: 'feature,keep'
days-before-stale: 45
days-before-close: 30
days-before-stale: 60
days-before-close: 60
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Refer to our [contributor documentation](CONTRIBUTING.md).

## Vulnerability Disclosures

Refer to our [vulnerability discolosure documentation](SECURITY.md) for submitting bugs.
Refer to our [Vulnerability Disclosure Documentation](SECURITY.md) for submitting bugs.

## Licensing

Expand Down
10 changes: 7 additions & 3 deletions app/api/v2/responses.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import json

from aiohttp import web
from json import JSONDecodeError

from aiohttp.web_exceptions import HTTPUnprocessableEntity
from marshmallow.exceptions import ValidationError

from app.api.v2 import errors
Expand Down Expand Up @@ -51,9 +55,9 @@ async def apispec_request_validation_middleware(request, handler):
)
except ValidationError as ex:
# ex: List of objects sent when single object expected
raise JsonHttpBadRequest(
error='Error parsing JSON: Could not validate Schema',
details=str(ex)
formatted_message = json.dumps({"json": ex.messages}, indent=2)
raise HTTPUnprocessableEntity(
text=formatted_message
)
except JSONDecodeError as ex:
raise JsonHttpBadRequest(
Expand Down

0 comments on commit 41eb7b4

Please sign in to comment.