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 error message for the json schemas of non str-keyed mappings. #412

Merged
merged 3 commits into from
Dec 12, 2022

Conversation

pchanial
Copy link
Contributor

The following results in an unhandled error:

from apischema.json_schema import serialization_schema
serialization_schema(dict)
File "/home/chanial/.cache/pypoetry/virtualenvs/sonouno-server-lh_mGmR0-py3.10/lib/python3.10/site-packages/apischema/json_schema/schema.py", line 221, in mapping
    if key["type"] != JsonType.STRING:
KeyError: 'type'

I have renamed the test file to be more inclusive. And xfailed one test, for which an Unsupported error is raised.

@codecov-commenter
Copy link

codecov-commenter commented May 15, 2022

Codecov Report

Merging #412 (3f58a30) into master (3c60d5f) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #412      +/-   ##
==========================================
+ Coverage   87.81%   87.84%   +0.03%     
==========================================
  Files          62       62              
  Lines        5685     5685              
  Branches     1236     1236              
==========================================
+ Hits         4992     4994       +2     
+ Misses        481      480       -1     
+ Partials      212      211       -1     
Impacted Files Coverage Δ
apischema/json_schema/schema.py 86.08% <100.00%> (+0.57%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@wyfo
Copy link
Owner

wyfo commented Dec 12, 2022

Good catch, thank you!
(sorry for the merge delay, I'd taken a long break)

@wyfo wyfo merged commit e21a818 into wyfo:master Dec 12, 2022
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

3 participants