smithy-json
JSONCodec
¶
Bases: Codec
A codec for converting shapes to/from JSON.
Source code in packages/smithy-json/src/smithy_json/__init__.py
__init__(use_json_name=True, use_timestamp_format=True, default_timestamp_format=TimestampFormat.DATE_TIME, default_namespace=None, document_class=JSONDocument)
¶
Initializes a JSONCodec.
:param use_json_name: Whether the codec should use smithy.api#jsonName
trait,
if present.
:param use_timestamp_format: Whether the codec should use the
smithy.api#timestampFormat
trait, if present.
:param default_timestamp_format: The default timestamp format to use if the
smithy.api#timestampFormat
trait is not enabled or not present.
:param default_namespace: The default namespace to use when determining a
document's discriminator.
:param document_class: The document class to deserialize to.
Source code in packages/smithy-json/src/smithy_json/__init__.py
JSONSettings
dataclass
¶
Settings for the JSON codec.
Source code in packages/smithy-json/src/smithy_json/settings.py
default_namespace = None
class-attribute
instance-attribute
¶
The default namespace to use when determining a document's discriminator.
default_timestamp_format = TimestampFormat.DATE_TIME
class-attribute
instance-attribute
¶
The default timestamp format to use if the smithy.api#timestampFormat
trait is
not enabled or not present.
document_class
instance-attribute
¶
The document class to deserialize to.
use_json_name = True
class-attribute
instance-attribute
¶
Whether the codec should use smithy.api#jsonName
trait, if present.
use_timestamp_format = True
class-attribute
instance-attribute
¶
Whether the codec should use the smithy.api#timestampFormat
trait, if
present.
settings
¶
JSONSettings
dataclass
¶
Settings for the JSON codec.
Source code in packages/smithy-json/src/smithy_json/settings.py
default_namespace = None
class-attribute
instance-attribute
¶
The default namespace to use when determining a document's discriminator.
default_timestamp_format = TimestampFormat.DATE_TIME
class-attribute
instance-attribute
¶
The default timestamp format to use if the smithy.api#timestampFormat
trait is
not enabled or not present.
document_class
instance-attribute
¶
The document class to deserialize to.
use_json_name = True
class-attribute
instance-attribute
¶
Whether the codec should use smithy.api#jsonName
trait, if present.
use_timestamp_format = True
class-attribute
instance-attribute
¶
Whether the codec should use the smithy.api#timestampFormat
trait, if
present.