Skip to content

Commit 1a53aca

Browse files
committed
Re-word api.serializer.json docstrings
- Make class docstrings wording consistent. - Emphasize that we use the OLPC Canonical JSON specification. Signed-off-by: Lukas Puehringer <[email protected]>
1 parent 7da5002 commit 1a53aca

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tuf/api/serialization/json.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
class JSONDeserializer(MetadataDeserializer):
29-
"""Provides JSON-to-Metadata deserialize method. """
29+
"""Provides JSON to Metadata deserialize method. """
3030

3131
def deserialize(self, raw_data: bytes) -> Metadata:
3232
"""Deserialize utf-8 encoded JSON bytes into Metadata object. """
@@ -41,7 +41,7 @@ def deserialize(self, raw_data: bytes) -> Metadata:
4141

4242

4343
class JSONSerializer(MetadataSerializer):
44-
"""A Metadata-to-JSON serialize method.
44+
"""Provides Metadata to JSON serialize method.
4545
4646
Attributes:
4747
compact: A boolean indicating if the JSON bytes generated in
@@ -68,10 +68,12 @@ def serialize(self, metadata_obj: Metadata) -> bytes:
6868

6969

7070
class CanonicalJSONSerializer(SignedSerializer):
71-
"""A Signed-to-Canonical JSON 'serialize' method. """
71+
"""Provides Signed to OLPC Canonical JSON serialize method. """
7272

7373
def serialize(self, signed_obj: Signed) -> bytes:
74-
"""Serialize Signed object into utf-8 encoded Canonical JSON bytes. """
74+
"""Serialize Signed object into utf-8 encoded OLPC Canonical JSON
75+
bytes.
76+
"""
7577
try:
7678
signed_dict = signed_obj.to_dict()
7779
canonical_bytes = encode_canonical(signed_dict).encode("utf-8")

0 commit comments

Comments
 (0)