Metron-Project / Simyan

A Python wrapper for the Comicvine API.
https://pypi.org/project/simyan
GNU General Public License v3.0
11 stars 2 forks source link

IssueResultSchema Validation Error #27

Closed bpepple closed 3 years ago

bpepple commented 3 years ago

Currently the IssueResultSchema has the has_staff_reviewfield defined as a boolean, but really it appears to be a Nested field which contains a id, name, api_detail_url, and site_detail_url fields. So, when a value is present it will kick out a marshmallow.exceptions.ValidationError.

It's easy enough to fix, tho I'm not 100% sure it's worth the effort since it seems to be data that would really only be pertinent for ComicVine internal use, and I'd be incline to just comment out the field and leave it as a placeholder.

To reproduce this bug, just add the following test:

def test_issue_list_staff_boolean(talker):
    wolv = talker.issue_list({"filter": f"volume:{85930}"})
    assert wolv[0].has_staff_review == True
Buried-In-Code commented 3 years ago

Looks like they use bool false if there isn't a review and a Nested field if there is... that's a pest. Makes me uncertain how many of their other fields are multi-typed.

As it's an internal use I agree it's less hassle to just remove it

bpepple commented 3 years ago

Looks like they use bool false if there isn't a review and a Nested field if there is... that's a pest. Makes me uncertain how many of their other fields are multi-typed.

Yeah, the documentation could really benefit by showed the data type of each field.