From 6c1a95d1c60c3f84fd400398e2da4731230d3edb Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Wed, 8 Jan 2025 10:26:15 -0500 Subject: [PATCH 1/2] Add top-level API to API docs; use explicit references to Schema (#2740) * Add back top-level API to docs * Use explicit references to marshmallow.Schmea * more --- CHANGELOG.rst | 4 +-- docs/api_reference.rst | 1 + docs/custom_fields.rst | 4 +-- docs/examples.rst | 4 +-- docs/extending.rst | 8 ++--- docs/nesting.rst | 2 +- docs/quickstart.rst | 14 ++++---- docs/top_level.rst | 12 +++++++ docs/upgrading.rst | 62 +++++++++++++++++------------------ src/marshmallow/decorators.py | 10 +++--- src/marshmallow/fields.py | 25 +++++++------- src/marshmallow/schema.py | 10 +++--- src/marshmallow/utils.py | 2 +- 13 files changed, 84 insertions(+), 74 deletions(-) create mode 100644 docs/top_level.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8991f354b..c36e89d6b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -295,7 +295,7 @@ Bug fixes: - Don't expose ``Field``\s as ``Schema`` attributes. This reverts a change introduced in 3.12.0 that causes issues when field names conflict with ``Schema`` attributes or methods. ``Fields``\s are still accessible on a - ``Schema`` instance through the ``fields`` attribute. (:pr:`1843`) + ``Schema`` instance through the ``fields`` attribute. (:pr:`1843`) 3.12.1 (2021-05-10) ******************* @@ -870,7 +870,7 @@ Bug fixes: Other changes: - *Backwards-incompatible*: ``_serialize`` and ``_deserialize`` methods of -all ``fields.Field`` subclasses must accept ``**kwargs`` (:pr:`1007`). + all ``fields.Field`` subclasses must accept ``**kwargs`` (:pr:`1007`). 3.0.0b18 (2018-10-15) diff --git a/docs/api_reference.rst b/docs/api_reference.rst index 68bc78484..bfd3de840 100644 --- a/docs/api_reference.rst +++ b/docs/api_reference.rst @@ -5,6 +5,7 @@ API Reference ************* .. toctree:: + top_level marshmallow.schema marshmallow.fields marshmallow.decorators diff --git a/docs/custom_fields.rst b/docs/custom_fields.rst index f1dd23e2f..53bd8259c 100644 --- a/docs/custom_fields.rst +++ b/docs/custom_fields.rst @@ -1,7 +1,7 @@ Custom fields ============= -There are three ways to create a custom-formatted field for a `Schema`: +There are three ways to create a custom-formatted field for a `Schema `: - Create a custom :class:`Field ` class - Use a :class:`Method ` field @@ -101,7 +101,7 @@ Adding context to `Method` and `Function` fields A :class:`Function ` or :class:`Method ` field may need information about its environment to know how to serialize a value. -In these cases, you can set the ``context`` attribute (a dictionary) of a `Schema`. :class:`Function ` and :class:`Method ` fields will have access to this dictionary. +In these cases, you can set the ``context`` attribute (a dictionary) of a `Schema `. :class:`Function ` and :class:`Method ` fields will have access to this dictionary. As an example, you might want your ``UserSchema`` to output whether or not a ``User`` is the author of a ``Blog`` or whether a certain word appears in a ``Blog's`` title. diff --git a/docs/examples.rst b/docs/examples.rst index d9dbf1dba..d01f5b5a1 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -1,5 +1,3 @@ -.. module:: marshmallow - ******** Examples ******** @@ -12,7 +10,7 @@ Below is a schema that could be used to validate ``package.json`` files. This example demonstrates the following features: -- Validation and deserialization using :meth:`Schema.load` +- Validation and deserialization using `Schema.load ` - :doc:`Custom fields ` - Specifying deserialization keys using ``data_key`` - Including unknown keys using ``unknown = INCLUDE`` diff --git a/docs/extending.rst b/docs/extending.rst index 352192f21..060300dfb 100644 --- a/docs/extending.rst +++ b/docs/extending.rst @@ -1,5 +1,3 @@ -.. module:: marshmallow - Extending schemas ================= @@ -213,6 +211,8 @@ The pipeline for serialization is similar, except that the ``pass_many=True`` pr def step2(self, data, **kwargs): do_step2(data) +.. _schema_validation: + Schema-level validation ----------------------- @@ -347,7 +347,7 @@ However, if you want to specify how values are accessed from an object, you can Custom error handling --------------------- -By default, :meth:`Schema.load` will raise a :exc:`ValidationError ` if passed invalid data. +By default, `Schema.load ` will raise a :exc:`ValidationError ` if passed invalid data. You can specify a custom error-handling function for a :class:`Schema` by overriding the `handle_error ` method. The method receives the :exc:`ValidationError ` and the original input data to be deserialized. @@ -457,7 +457,7 @@ Our application schemas can now inherit from our custom schema class. Using context ------------- -The ``context`` attribute of a `Schema` is a general-purpose store for extra information that may be needed for (de)serialization. It may be used in both ``Schema`` and ``Field`` methods. +The ``context`` attribute of a `Schema ` is a general-purpose store for extra information that may be needed for (de)serialization. It may be used in both ``Schema`` and ``Field`` methods. .. code-block:: python diff --git a/docs/nesting.rst b/docs/nesting.rst index e8e3694f0..e24ae5fb0 100644 --- a/docs/nesting.rst +++ b/docs/nesting.rst @@ -261,7 +261,7 @@ This is useful for avoiding circular imports when your schemas are located in di Nesting a schema within itself ------------------------------ -If the object to be marshalled has a relationship to an object of the same type, you can nest the `Schema` within itself by passing a callable that returns an instance of the same schema. +If the object to be marshalled has a relationship to an object of the same type, you can nest the `Schema ` within itself by passing a callable that returns an instance of the same schema. .. code-block:: python diff --git a/docs/quickstart.rst b/docs/quickstart.rst index e08c7ef93..f09c9c351 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -1,5 +1,3 @@ -.. module:: marshmallow - Quickstart ========== @@ -176,7 +174,7 @@ Set ``many=True`` when dealing with iterable collections of objects. Validation ---------- -:meth:`Schema.load` (and its JSON-decoding counterpart, :meth:`Schema.loads`) raises a :exc:`ValidationError ` error when invalid data are passed in. You can access the dictionary of validation errors from the `ValidationError.messages ` attribute. The data that were correctly deserialized are accessible in `ValidationError.valid_data `. Some fields, such as the :class:`Email ` and :class:`URL ` fields, have built-in validation. +`Schema.load ` (and its JSON-decoding counterpart, `Schema.loads `) raises a :exc:`ValidationError ` error when invalid data are passed in. You can access the dictionary of validation errors from the `ValidationError.messages ` attribute. The data that were correctly deserialized are accessible in `ValidationError.valid_data `. Some fields, such as the :class:`Email ` and :class:`URL ` fields, have built-in validation. .. code-block:: python @@ -275,7 +273,7 @@ You may also pass a collection (list, tuple, generator) of callables to ``valida .. warning:: Validation occurs on deserialization but not on serialization. - To improve serialization performance, data passed to :meth:`Schema.dump` + To improve serialization performance, data passed to `Schema.dump ` are considered valid. .. seealso:: @@ -286,7 +284,7 @@ You may also pass a collection (list, tuple, generator) of callables to ``valida .. seealso:: - Need schema-level validation? See the :ref:`Extending Schemas ` page. + Need schema-level validation? See the :ref:`Extending Schemas ` page. Field validators as methods @@ -313,7 +311,7 @@ It is sometimes convenient to write validators as methods. Use the `validates `. To customize the error message for required fields, pass a `dict` with a ``required`` key as the ``error_messages`` argument for the field. @@ -405,7 +403,7 @@ This behavior can be modified with the ``unknown`` option, which accepts one of - `EXCLUDE `: exclude unknown fields - `INCLUDE `: accept and include the unknown fields -You can specify ``unknown`` in the *class Meta* of your `Schema`, +You can specify ``unknown`` in the *class Meta* of your `Schema `, .. code-block:: python @@ -436,7 +434,7 @@ This order of precedence allows you to change the behavior of a schema for diffe Validation without deserialization ---------------------------------- -If you only need to validate input data (without deserializing to an object), you can use :meth:`Schema.validate`. +If you only need to validate input data (without deserializing to an object), you can use `Schema.validate `. .. code-block:: python diff --git a/docs/top_level.rst b/docs/top_level.rst new file mode 100644 index 000000000..2a982997e --- /dev/null +++ b/docs/top_level.rst @@ -0,0 +1,12 @@ +Top-level API +============= + +.. automodule:: marshmallow + :members: + :undoc-members: + :autosummary: + +.. data:: EXCLUDE +.. data:: INCLUDE +.. data:: RAISE +.. data:: missing diff --git a/docs/upgrading.rst b/docs/upgrading.rst index 8145817bb..0102fc0b4 100644 --- a/docs/upgrading.rst +++ b/docs/upgrading.rst @@ -6,7 +6,7 @@ This section documents migration paths to new releases. Upgrading to 3.3 ++++++++++++++++ -In 3.3, `fields.Nested ` may take a callable that returns a schema instance. +In 3.3, `fields.Nested ` may take a callable that returns a schema instance. Use this to resolve order-of-declaration issues when schemas nest each other. .. code-block:: python @@ -103,15 +103,15 @@ along with the valid data from the `ValidationError.valid_data errors = err.messages valid_data = err.valid_data -:meth:`Schema.validate() ` always returns a dictionary of validation errors (same as 2.x with ``strict=False``). +`Schema.validate ` always returns a dictionary of validation errors (same as 2.x with ``strict=False``). .. code-block:: python schema.validate({"email": "invalid"}) # {'email': ['Not a valid email address.']} -Setting the ``strict`` option on ``class Meta`` has no effect on `Schema` behavior. -Passing ``strict=True`` or ``strict=False`` to the `Schema` constructor +Setting the ``strict`` option on ``class Meta`` has no effect on `Schema ` behavior. +Passing ``strict=True`` or ``strict=False`` to the `Schema ` constructor will raise a :exc:`TypeError`. @@ -182,7 +182,7 @@ and `validates_schema ` receive Validation does not occur on serialization ****************************************** -:meth:`Schema.dump() ` will no longer validate and collect error messages. You *must* validate +`Schema.dump ` will no longer validate and collect error messages. You *must* validate your data before serializing it. .. code-block:: python @@ -737,7 +737,7 @@ The same key is used for serialization and deserialization. email = fields.Email(data_key="CamelCasedEmail") It is not possible to specify a different key for serialization and deserialization on the same field. -This use case is covered by using two different `Schema`. +This use case is covered by using two different `Schema `. .. code-block:: python @@ -970,8 +970,8 @@ The ``prefix`` parameter of ``Schema`` is removed. The same feature can be achie # 2.x class MySchema(Schema): - f1 = fields.Field() - f2 = fields.Field() + f1 = fields.Raw() + f2 = fields.Raw() MySchema(prefix="pre_").dump({"f1": "one", "f2": "two"}) @@ -980,8 +980,8 @@ The ``prefix`` parameter of ``Schema`` is removed. The same feature can be achie # 3.x class MySchema(Schema): - f1 = fields.Field() - f2 = fields.Field() + f1 = fields.Raw() + f2 = fields.Raw() @post_dump def prefix_usr(self, data): @@ -1025,10 +1025,10 @@ In marshmallow 2, it was possible to have multiple fields with the same ``attrib # 2.x class MySchema(Schema): - f1 = fields.Field() - f2 = fields.Field(attribute="f1") - f3 = fields.Field(attribute="f5") - f4 = fields.Field(attribute="f5") + f1 = fields.Raw() + f2 = fields.Raw(attribute="f1") + f3 = fields.Raw(attribute="f5") + f4 = fields.Raw(attribute="f5") MySchema() @@ -1037,10 +1037,10 @@ In marshmallow 2, it was possible to have multiple fields with the same ``attrib # 3.x class MySchema(Schema): - f1 = fields.Field() - f2 = fields.Field(attribute="f1") - f3 = fields.Field(attribute="f5") - f4 = fields.Field(attribute="f5") + f1 = fields.Raw() + f2 = fields.Raw(attribute="f1") + f3 = fields.Raw(attribute="f5") + f4 = fields.Raw(attribute="f5") MySchema() @@ -1048,10 +1048,10 @@ In marshmallow 2, it was possible to have multiple fields with the same ``attrib class MySchema(Schema): - f1 = fields.Field() - f2 = fields.Field(attribute="f1", dump_only=True) - f3 = fields.Field(attribute="f5") - f4 = fields.Field(attribute="f5", dump_only=True) + f1 = fields.Raw() + f2 = fields.Raw(attribute="f1", dump_only=True) + f3 = fields.Raw(attribute="f5") + f4 = fields.Raw(attribute="f5", dump_only=True) MySchema() @@ -1061,7 +1061,7 @@ In marshmallow 2, it was possible to have multiple fields with the same ``attrib ``Field.fail`` is deprecated in favor of ``Field.make_error`` ************************************************************* -`Field.fail ` is deprecated. +`Field.fail ` is deprecated. Use `Field.make_error `. This allows you to re-raise exceptions using ``raise ... from ...``. @@ -1242,7 +1242,7 @@ As a consequence of this new behavior, the ``skip_missing`` class Meta option ha Pre-processing and post-processing methods ****************************************** -The pre- and post-processing API was significantly improved for better consistency and flexibility. The `pre_load `, `post_load `, `pre_dump `, and `post_dump ` should be used to define processing hooks. `Schema.preprocessor` and `Schema.data_handler` are removed. +The pre- and post-processing API was significantly improved for better consistency and flexibility. The `pre_load `, `post_load `, `pre_dump `, and `post_dump ` should be used to define processing hooks. ``Schema.preprocessor`` and ``Schema.data_handler`` are removed. .. code-block:: python @@ -1289,7 +1289,7 @@ See the :doc:`Extending Schemas ` page for more information on the `` Schema validators ***************** -Similar to pre-processing and post-processing methods, schema validators are now defined as methods. Decorate schema validators with `validates_schema `. `Schema.validator` is removed. +Similar to pre-processing and post-processing methods, schema validators are now defined as methods. Decorate schema validators with `validates_schema `. ``Schema.validator`` is removed. .. code-block:: python @@ -1324,7 +1324,7 @@ Similar to pre-processing and post-processing methods, schema validators are now Custom accessors and error handlers *********************************** -Custom accessors and error handlers are now defined as methods. `Schema.accessor` and `Schema.error_handler` are deprecated. +Custom accessors and error handlers are now defined as methods. ``Schema.accessor`` and ``Schema.error_handler`` are deprecated. .. code-block:: python @@ -1432,7 +1432,7 @@ The :exc:`MarshallingError` and :exc:`UnmarshallingError` exceptions are depreca Handle ``ValidationError`` in strict mode ----------------------------------------- -When using `strict` mode, you should handle `ValidationErrors` when calling `Schema.dump` and `Schema.load`. +When using `strict` mode, you should handle `ValidationErrors` when calling `Schema.dump ` and `Schema.load `. .. code-block:: python @@ -1707,7 +1707,7 @@ Perhaps the largest change is in how objects get serialized. Serialization occur .. note:: - Some crucial parts of the pre-1.0 API have been retained to ease the transition. You can still pass an object to a `Schema` constructor and access the `Schema.data` and `Schema.errors` properties. The `is_valid` method, however, has been completely removed. It is recommended that you migrate to the new API to prevent future releases from breaking your code. + Some crucial parts of the pre-1.0 API have been retained to ease the transition. You can still pass an object to a `Schema ` constructor and access the `Schema.data` and `Schema.errors` properties. The `is_valid` method, however, has been completely removed. It is recommended that you migrate to the new API to prevent future releases from breaking your code. The Fields interface was also reworked in 1.0 to make it easier to define custom fields with their own serialization and deserialization behavior. Custom fields now implement :meth:`Field._serialize` and :meth:`Field._deserialize`. @@ -1753,11 +1753,11 @@ Another major change in 1.0 is that multiple validation errors can be stored for Other notable changes: -- Serialized output is no longer an `OrderedDict` by default. You must explicitly set the `ordered` class Meta option to `True` . -- :class:`Serializer` has been renamed to :class:`Schema`, but you can still import `marshmallow.Serializer` (which is aliased to :class:`Schema`). +- Serialized output is no longer an ``OrderedDict`` by default. You must explicitly set the `ordered` class Meta option to `True` . +- ``Serializer`` has been renamed to `Schema `, but you can still import ``marshmallow.Serializer`` (which is aliased to `Schema `). - ``datetime`` objects serialize to ISO8601-formatted strings by default (instead of RFC821 format). - The ``fields.validated`` decorator was removed, as it is no longer necessary given the new Fields interface. -- `Schema.factory` class method was removed. +- ``Schema.factory`` class method was removed. .. seealso:: diff --git a/src/marshmallow/decorators.py b/src/marshmallow/decorators.py index 965edb68b..bc439526f 100644 --- a/src/marshmallow/decorators.py +++ b/src/marshmallow/decorators.py @@ -100,7 +100,7 @@ def validates_schema( """Register a schema-level validator. By default it receives a single object at a time, transparently handling the ``many`` - argument passed to the `Schema`'s :func:`~marshmallow.Schema.validate` call. + argument passed to the `Schema `'s :func:`~marshmallow.Schema.validate` call. If ``pass_many=True``, the raw data (which may be a collection) is passed. If ``pass_original=True``, the original data (before unmarshalling) will be passed as @@ -132,7 +132,7 @@ def pre_dump( receives the object to be serialized and returns the processed object. By default it receives a single object at a time, transparently handling the ``many`` - argument passed to the `Schema`'s :func:`~marshmallow.Schema.dump` call. + argument passed to the `Schema `'s :func:`~marshmallow.Schema.dump` call. If ``pass_many=True``, the raw data (which may be a collection) is passed. .. versionchanged:: 3.0.0 @@ -150,7 +150,7 @@ def post_dump( receives the serialized object and returns the processed object. By default it receives a single object at a time, transparently handling the ``many`` - argument passed to the `Schema`'s :func:`~marshmallow.Schema.dump` call. + argument passed to the `Schema `'s :func:`~marshmallow.Schema.dump` call. If ``pass_many=True``, the raw data (which may be a collection) is passed. If ``pass_original=True``, the original data (before serializing) will be passed as @@ -169,7 +169,7 @@ def pre_load( receives the data to be deserialized and returns the processed data. By default it receives a single object at a time, transparently handling the ``many`` - argument passed to the `Schema`'s :func:`~marshmallow.Schema.load` call. + argument passed to the `Schema `'s :func:`~marshmallow.Schema.load` call. If ``pass_many=True``, the raw data (which may be a collection) is passed. .. versionchanged:: 3.0.0 @@ -188,7 +188,7 @@ def post_load( receives the deserialized data and returns the processed data. By default it receives a single object at a time, transparently handling the ``many`` - argument passed to the `Schema`'s :func:`~marshmallow.Schema.load` call. + argument passed to the `Schema `'s :func:`~marshmallow.Schema.load` call. If ``pass_many=True``, the raw data (which may be a collection) is passed. If ``pass_original=True``, the original data (before deserializing) will be passed as diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py index 0f9926574..d503b59c5 100644 --- a/src/marshmallow/fields.py +++ b/src/marshmallow/fields.py @@ -361,7 +361,7 @@ def deserialize( :param value: The value to deserialize. :param attr: The attribute/key in `data` to deserialize. - :param data: The raw input data passed to `Schema.load`. + :param data: The raw input data passed to `Schema.load `. :param kwargs: Field-specific keyword arguments. :raise ValidationError: If an invalid value is passed or if a required value is missing. @@ -382,7 +382,7 @@ def deserialize( def _bind_to_schema(self, field_name: str, schema: Schema | Field) -> None: """Update field with values from its parent schema. Called by - :meth:`Schema._bind_field `. + `Schema._bind_field `. :param str field_name: Field name set in schema. :param Schema|Field schema: Parent object. @@ -426,7 +426,7 @@ def _deserialize( :param value: The value to be deserialized. :param attr: The attribute/key in `data` to be deserialized. - :param data: The raw input data passed to the `Schema.load`. + :param data: The raw input data passed to the `Schema.load `. :param kwargs: Field-specific keyword arguments. :raise ValidationError: In case of formatting or validation failure. :return: The deserialized value. @@ -440,7 +440,7 @@ def _deserialize( @property def context(self) -> dict | None: - """The context dictionary for the parent :class:`Schema`.""" + """The context dictionary for the parent `Schema `.""" if self.parent: return self.parent.context return None @@ -527,8 +527,9 @@ class ParentSchema(Schema): # No author = fields.Nested(UserSchema(), only=("id", "name")) - :param nested: `Schema` instance, class, class name (string), dictionary, or callable that - returns a `Schema` or dictionary. Dictionaries are converted with `Schema.from_dict`. + :param nested: `Schema ` instance, class, class name (string), dictionary, or callable that + returns a `Schema ` or dictionary. + Dictionaries are converted with `Schema.from_dict `. :param exclude: A list or tuple of fields to exclude. :param only: A list or tuple of fields to marshal. If `None`, all fields are marshalled. This parameter takes precedence over ``exclude``. @@ -583,10 +584,10 @@ def __init__( @property def schema(self) -> Schema: - """The nested Schema object. + """The nested `Schema ` object. .. versionchanged:: 1.0.0 - Renamed from `serializer` to `schema`. + Renamed from ``serializer`` to ``schema``. """ if not self._schema: # Inherit context from parent. @@ -681,8 +682,8 @@ def _deserialize( ) -> typing.Any: """Same as :meth:`Field._deserialize` with additional ``partial`` argument. - :param bool|tuple partial: For nested schemas, the ``partial`` - parameter passed to `Schema.load`. + :param partial: For nested schemas, the ``partial`` + parameter passed to `marshmallow.Schema.load`. .. versionchanged:: 3.0.0 Add ``partial`` parameter. @@ -713,7 +714,7 @@ class AlbumSchema(Schema): dumped = AlbumSchema().dump(loaded) # => {'artist': 42} :param Schema nested: The Schema class or class name (string) - to nest, or ``"self"`` to nest the :class:`Schema` within itself. + to nest, or ``"self"`` to nest the `Schema ` within itself. :param str field_name: The key to pluck a value from. :param kwargs: The same keyword arguments that :class:`Nested` receives. """ @@ -1965,7 +1966,7 @@ def _deserialize(self, value, attr, data, **kwargs): class Method(Field): - """A field that takes the value returned by a `Schema` method. + """A field that takes the value returned by a `Schema ` method. :param str serialize: The name of the Schema method from which to retrieve the value. The method must take an argument ``obj`` diff --git a/src/marshmallow/schema.py b/src/marshmallow/schema.py index 72b6a0407..e6282cdac 100644 --- a/src/marshmallow/schema.py +++ b/src/marshmallow/schema.py @@ -344,15 +344,15 @@ class Meta: - ``timeformat``: Default format for `Time ` fields. - ``render_module``: Module to use for `loads ` and `dumps `. Defaults to `json` from the standard library. - - ``ordered``: If `True`, output of `Schema.dump` will be a `collections.OrderedDict`. + - ``ordered``: If `True`, output of `Schema.dump ` will be a `collections.OrderedDict`. - ``index_errors``: If `True`, errors dictionaries will include the index of invalid items in a collection. - ``load_only``: Tuple or list of fields to exclude from serialized results. - ``dump_only``: Tuple or list of fields to exclude from deserialization - ``unknown``: Whether to exclude, include, or raise an error for unknown fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`. - - ``register``: Whether to register the `Schema` with marshmallow's internal - class registry. Must be `True` if you intend to refer to this `Schema` + - ``register``: Whether to register the `Schema ` with marshmallow's internal + class registry. Must be `True` if you intend to refer to this `Schema ` by class name in `Nested` fields. Only set this to `False` when memory usage is critical. Defaults to `True`. """ @@ -428,7 +428,7 @@ def from_dict( *, name: str = "GeneratedSchema", ) -> type[Schema]: - """Generate a `Schema` class given a dictionary of fields. + """Generate a `Schema ` class given a dictionary of fields. .. code-block:: python @@ -1016,7 +1016,7 @@ def _init_fields(self) -> None: self.load_fields = load_fields def on_bind_field(self, field_name: str, field_obj: ma_fields.Field) -> None: - """Hook to modify a field when it is bound to the `Schema`. + """Hook to modify a field when it is bound to the `Schema `. No-op by default. """ diff --git a/src/marshmallow/utils.py b/src/marshmallow/utils.py index 63e8f775f..27779cbad 100644 --- a/src/marshmallow/utils.py +++ b/src/marshmallow/utils.py @@ -39,7 +39,7 @@ def __repr__(self): # Singleton value that indicates that a field's value is missing from input -# dict passed to :meth:`Schema.load`. If the field's value is not required, +# dict passed to `Schema.load `. If the field's value is not required, # it's ``default`` value is used. missing = _Missing() From 202dbb39643ea957c73c8b3d1ef3b4f7025295b5 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Wed, 8 Jan 2025 10:27:54 -0500 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c36e89d6b..21d94d7b7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,14 @@ Changelog --------- +3.24.2 (unreleased) +******************* + +Documentation: + +- Add top-level API back to docs (:issue:`2739`). + Thanks :user:`llucax` for reporting. + 3.24.1 (2025-01-06) *******************