From c226c0f03aefebd21d7b99762e5f3e6d790ac747 Mon Sep 17 00:00:00 2001 From: Alexander Tikhonov Date: Sat, 23 Nov 2024 15:54:14 +0300 Subject: [PATCH] Use cleandoc in DocstringDescriptionPlugin --- mashumaro/jsonschema/plugins.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mashumaro/jsonschema/plugins.py b/mashumaro/jsonschema/plugins.py index 0974d07..3396c9c 100644 --- a/mashumaro/jsonschema/plugins.py +++ b/mashumaro/jsonschema/plugins.py @@ -1,4 +1,5 @@ from dataclasses import is_dataclass +from inspect import cleandoc from typing import Optional from mashumaro.jsonschema.models import Context, JSONSchema @@ -23,5 +24,5 @@ def get_schema( schema: Optional[JSONSchema] = None, ) -> Optional[JSONSchema]: if schema and is_dataclass(instance.type) and instance.type.__doc__: - schema.description = instance.type.__doc__ + schema.description = cleandoc(instance.type.__doc__) return None