U
    2eL                     @   sF   d dl Z e dZG dd deZG dd deZG dd deZdS )	    Nz	[\.\[\]]+c                   @   s   e Zd ZdZdS )JsonSchemaExceptionz7
    Base exception of ``fastjsonschema`` library.
    N__name__
__module____qualname____doc__ r   r   8lib/python3.8/site-packages/fastjsonschema/exceptions.pyr      s   r   c                       s:   e Zd ZdZd	 fdd	Zedd Zedd Z  ZS )
JsonSchemaValueExceptiona  
    Exception raised by validation function. Available properties:

     * ``message`` containing human-readable information what is wrong (e.g. ``data.property[index] must be smaller than or equal to 42``),
     * invalid ``value`` (e.g. ``60``),
     * ``name`` of a path in the data structure (e.g. ``data.property[index]``),
     * ``path`` as an array in the data structure (e.g. ``['data', 'property', 'index']``),
     * the whole ``definition`` which the ``value`` has to fulfil (e.g. ``{'type': 'number', 'maximum': 42}``),
     * ``rule`` which the ``value`` is breaking (e.g. ``maximum``)
     * and ``rule_definition`` (e.g. ``42``).

    .. versionchanged:: 2.14.0
        Added all extra properties.
    Nc                    s.   t  | || _|| _|| _|| _|| _d S N)super__init__messagevaluename
definitionrule)selfr   r   r   r   r   	__class__r   r	   r      s    z!JsonSchemaValueException.__init__c                 C   s   dd t | jD S )Nc                 S   s   g | ]}|d kr|qS ) r   ).0itemr   r   r	   
<listcomp>'   s      z1JsonSchemaValueException.path.<locals>.<listcomp>)SPLIT_REsplitr   r   r   r   r	   path%   s    zJsonSchemaValueException.pathc                 C   s   | j r| jsd S | j| j S r   )r   r   getr   r   r   r	   rule_definition)   s    z(JsonSchemaValueException.rule_definition)NNNN)	r   r   r   r   r   propertyr   r   __classcell__r   r   r   r	   r
      s   
r
   c                   @   s   e Zd ZdZdS )JsonSchemaDefinitionExceptionz?
    Exception raised by generator of validation function.
    Nr   r   r   r   r	   r"   0   s   r"   )recompiler   
ValueErrorr   r
   r"   r   r   r   r	   <module>   s   
#