Skip to content

Error out in human friendly way if mimetype is missing on response #57

Open
@domenkozar

Description

@domenkozar

Currently one gets:

../../../../.local/share/virtualenvs/woocart-api-zie1bQwL/lib/python3.6/site-packages/openapi_core/validation/response/validators.py:37: in validate
    data, data_errors = self._get_data(response, operation_response)
../../../../.local/share/virtualenvs/woocart-api-zie1bQwL/lib/python3.6/site-packages/openapi_core/validation/response/validators.py:53: in _get_data
    media_type = operation_response[response.mimetype]
../../../../.local/share/virtualenvs/woocart-api-zie1bQwL/lib/python3.6/site-packages/openapi_core/schema/responses/models.py:21: in __getitem__
    return self.content[mimetype]
../../../../.local/share/virtualenvs/woocart-api-zie1bQwL/lib/python3.6/site-packages/openapi_core/schema/content/models.py:18: in __getitem__
    if fnmatch.fnmatch(mimetype, key):  
../../../../.local/share/virtualenvs/woocart-api-zie1bQwL/lib/python3.6/fnmatch.py:34: in fnmatch
    name = os.path.normcase(name)                                  
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
                                          
s = None                             
       
    def normcase(s):                                                                                                                                     
        """Normalize case of pathname.  Has no effect under Posix"""
>       s = os.fspath(s)
E       TypeError: expected str, bytes or os.PathLike object, not NoneType

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions