Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed May 18, 2024
1 parent d665325 commit 6ff5cb8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/plone/restapi/serializer/dxcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ def check_permission(self, permission_name, obj):
@implementer(ISerializeToJson)
@adapter(IDexterityContainer, Interface)
class SerializeFolderToJson(SerializeToJson):

@classmethod
def __restapi_doc_component_schema__(cls, context, request):
result = super(cls, SerializeFolderToJson).__restapi_doc_component_schema__(
Expand Down
1 change: 0 additions & 1 deletion src/plone/restapi/serializer/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
@implementer(ISerializeToJson)
@adapter(IPloneSiteRoot, Interface)
class SerializeSiteRootToJson:

@classmethod
def __restapi_doc_component_schema__(cls, context, request):
fields_adapter = []
Expand Down
17 changes: 4 additions & 13 deletions src/plone/restapi/services/content/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ class ContentGet(Service):

@classmethod
def __restapi_doc_component_schemas_extension__(cls):
doc = super(
ContentGet, cls
).__restapi_doc_component_schemas_extension__()
doc = super(ContentGet, cls).__restapi_doc_component_schemas_extension__()

# recupero le interfacce per cui il service è stato registrato
services = [
Expand Down Expand Up @@ -46,15 +44,12 @@ def __restapi_doc_component_schemas_extension__(cls):
# di contenuto
definition = {}
for fti in ftis:
serializer = queryMultiAdapter(
(fti[1], getRequest()), ISerializeToJson
)
serializer = queryMultiAdapter((fti[1], getRequest()), ISerializeToJson)
if method := getattr(serializer, "__restapi_doc_component_schema__", None):
definition.update(**method(fti[1], getRequest()))

return definition


@classmethod
def __restapi_doc__(cls):
return {
Expand All @@ -77,9 +72,7 @@ def __restapi_doc__(cls):
"description": "ServerError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
"schema": {"$ref": "#/components/schemas/ErrorResponse"}
}
},
},
Expand All @@ -88,9 +81,7 @@ def __restapi_doc__(cls):
}

def reply(self):
serializer = queryMultiAdapter(
(self.context, self.request), ISerializeToJson
)
serializer = queryMultiAdapter((self.context, self.request), ISerializeToJson)

if serializer is None:
self.request.response.setStatus(501)
Expand Down

0 comments on commit 6ff5cb8

Please sign in to comment.