Skip to content

Commit

Permalink
🧑‍💻 Block Sphinx docstrings from being used in API schema
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Aug 22, 2024
1 parent 15292df commit 2752e19
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/openforms/api/drf_spectacular/plumbing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ResolvedComponent,
build_basic_type,
build_parameter_type,
get_lib_doc_excludes as _get_lib_doc_excludes,
)
from drf_spectacular.utils import OpenApiParameter, inline_serializer
from rest_framework.fields import Field
Expand Down Expand Up @@ -72,3 +73,13 @@ def extend_inline_serializer(
return inline_serializer(
name or serializer.__name__, serializer().get_fields() | fields, **kwargs
)


def get_lib_doc_excludes():
from openforms.contrib.zgw.api.serializers import CatalogueSerializer

base = _get_lib_doc_excludes()
extra = [
CatalogueSerializer,
]
return [*base, *extra]
1 change: 1 addition & 0 deletions src/openforms/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,7 @@
"AvailableLanguagesEnum": "django.conf.settings.LANGUAGES",
"StatementCheckboxEnum": "openforms.forms.constants.StatementCheckboxChoices",
},
"GET_LIB_DOC_EXCLUDES": "openforms.api.drf_spectacular.plumbing.get_lib_doc_excludes",
}

#
Expand Down

0 comments on commit 2752e19

Please sign in to comment.