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

TypeError('expected string or bytes-like object') #147

Open
hmoffatt opened this issue Sep 22, 2021 · 0 comments
Open

TypeError('expected string or bytes-like object') #147

hmoffatt opened this issue Sep 22, 2021 · 0 comments

Comments

@hmoffatt
Copy link

hmoffatt commented Sep 22, 2021

I get this exception when validating a test file:

from swagger_spec_validator import validate_spec_url
validate_spec_url('file:///home/hamish/tmp/swagger/test.yaml')
  File "/home/hamish/tmp/swagger/.pyvenv/lib/python3.9/site-packages/jsonschema/_utils.py", line 98, in find_additional_properties
    if patterns and re.search(patterns, property):
  File "/usr/lib/python3.9/re.py", line 201, in search
    return _compile(pattern, flags).search(string)
TypeError: expected string or bytes-like object
---
swagger: '2.0'

info:
  version: "0.0.0"
  title: Foo

schemes:
  - https

paths:
  /token/:
    post:
      summary: Login
      tags:
        - auth
      description: |
        Login and obtain an authorization token.
      responses:
        200:
          description: Authorization token
          schema:
            title: Token
            type: object
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

No branches or pull requests

1 participant