| Server IP : 35.236.43.222 / Your IP : 216.73.216.143 Web Server : Apache System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64 User : deploy ( 1002) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/josepy/__pycache__/ |
Upload File : |
a
��]�= � @ s� d Z ddlZddlZddlZddlZddlZddlmZmZm Z m
Z
e�e�Z
G dd� de�ZG dd� dej�Ze�e�G dd � d e
je j��Zd
d� Zdd
d�Zdd� Zddd�Zdd� Zdd� Zdd� Zdd� ZG dd� de�ZdS )z�JSON (de)serialization framework.
The framework presented here is somewhat based on `Go's "json" package`_
(especially the ``omitempty`` functionality).
.. _`Go's "json" package`: http://golang.org/pkg/encoding/json/
� N)�b64�errors�
interfaces�utilc @ sr e Zd ZdZdZddd�Zedd� �Zd d
� Zdd� Z d
d� Z
dd� Zdd� Zdd� Z
edd� �Zedd� �ZdS )�Fielda� JSON object field.
:class:`Field` is meant to be used together with
:class:`JSONObjectWithFields`.
``encoder`` (``decoder``) is a callable that accepts a single
parameter, i.e. a value to be encoded (decoded), and returns the
serialized (deserialized) value. In case of errors it should raise
:class:`~josepy.errors.SerializationError`
(:class:`~josepy.errors.DeserializationError`).
Note, that ``decoder`` should perform partial serialization only.
:ivar str json_name: Name of the field when encoded to JSON.
:ivar default: Default value (used when not present in JSON object).
:ivar bool omitempty: If ``True`` and the field value is empty, then
it will not be included in the serialized JSON object, and
``default`` will be used for deserialization. Otherwise, if ``False``,
field is considered as required, value will always be included in the
serialized JSON objected, and it must also be present when
deserializing.
)� json_name�default� omitempty�fdec�fencNFc C s>