I'm trying to figure out why isinstance
doesn't seem to be working for me. Is it because I'm using strings or could the post data format be wrong (I print it to the output and it looks right)
class Dogs(enum.Enum):
poodle= 'poodle'
terrier= 'terrier'
@blueprint.route('/test/<int:test_id>', methods=['post'])
def test(int:test_id):
data = request.json
print(data) #it's poodle
if isinstance(data, Dog):
return HTTPStatus.OK
return HTTPStatus.BAD_REQUEST