From 473d60d5f3f00fd3e69f64dd3ba7e04defc175e3 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Sun, 27 Feb 2022 10:33:18 +0200 Subject: [PATCH] fix documentation plugin paths builder when multiple contentTypes --- .../server/utils/builders/build-api-endpoint-path.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/plugins/documentation/server/utils/builders/build-api-endpoint-path.js b/packages/plugins/documentation/server/utils/builders/build-api-endpoint-path.js index 4f7c77bdc0..7253638af6 100644 --- a/packages/plugins/documentation/server/utils/builders/build-api-endpoint-path.js +++ b/packages/plugins/documentation/server/utils/builders/build-api-endpoint-path.js @@ -149,6 +149,7 @@ module.exports = api => { } // An api could have multiple contentTypes + let paths = {}; for (const contentTypeName of api.ctNames) { // Get the attributes found on the api's contentType const uid = `${api.getter}::${api.name}.${contentTypeName}`; @@ -169,6 +170,11 @@ module.exports = api => { tag, }; - return getPaths(apiInfo); + paths = { + ...paths, + ...getPaths(apiInfo).paths + } } + + return { paths }; };