for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
"""Schema implementation based on JSONSchema v4 draft
"""
from __future__ import (
absolute_import,
division,
print_function
)
import logging
import jsonschema
jsonschema
This can be caused by one of the following:
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
# .scrutinizer.yml before_commands: - sudo pip install abc # Python2 - sudo pip3 install abc # Python3
This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.
__init__.py
from jsonschema import (
SchemaError,
ValidationError
_LOGGER = logging.getLogger(__name__)
class SchemaValidator(object):
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
__slots__ = ('_input_validator')
def __init__(self, input_spec):
if input_spec:
try:
self._input_validator = jsonschema.Draft4Validator(input_spec)
except jsonschema.SchemaError:
raise
else:
self._input_validator = None
def validate(self, some_input):
if self._input_validator is not None:
self._input_validator.validate(some_input)
return True
except jsonschema.ValidationError:
# No input schema meams we accept everything
__all__ = [
'SchemaError',
'SchemaValidator',
'ValidationError',
]
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.py
files in your module folders. Make sure that you place one file in each sub-folder.