UD - FLASK - Serialization
1. Vanilla marshmallow
from marshmallow import Schema, fields
class BookSchema(Schema):
title = fields.Str()
author = fields.Str()
class Book:
def __init__(self, title, author, description):
self.title = title
self.author = author
self.description = description1.1. Serialization -> dict
1.2. Deserialization -> object
2. Flask-marshmallow
2.1. Components
2.2. Nested schema
Last updated