@adaptivestone/framework 3.4.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/commands/GetOpenApiJson.js +9 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -90,15 +90,15 @@ class GetOpenApiJson extends AbstractCommand {
|
|
|
90
90
|
];
|
|
91
91
|
|
|
92
92
|
const securitySchemaNames = [];
|
|
93
|
-
|
|
93
|
+
let permissionString = '';
|
|
94
94
|
if (middlewares?.length) {
|
|
95
95
|
for (const middleware of middlewares) {
|
|
96
96
|
if (middleware?.authParams?.length) {
|
|
97
97
|
for (const authParam of middleware.authParams) {
|
|
98
98
|
const { permissions, ...mainFields } = authParam;
|
|
99
|
-
|
|
99
|
+
const fullName = authParam.name;
|
|
100
100
|
if (permissions) {
|
|
101
|
-
|
|
101
|
+
permissionString = permissions;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
if (!openApi.components.securitySchemes[fullName]) {
|
|
@@ -148,10 +148,12 @@ class GetOpenApiJson extends AbstractCommand {
|
|
|
148
148
|
openApi.paths[routeName] = {};
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
const methodName = route[Object.keys(route)[0]].method.toLowerCase();
|
|
152
|
-
const routeTitle = route[Object.keys(route)[0]].name;
|
|
153
151
|
const routeDescription =
|
|
154
152
|
route[Object.keys(route)[0]]?.description || 'empty description';
|
|
153
|
+
const routeDescriptionWithPermissions = `${permissionString} ${routeDescription}`;
|
|
154
|
+
const methodName = route[Object.keys(route)[0]].method.toLowerCase();
|
|
155
|
+
const routeTitle = route[Object.keys(route)[0]].name;
|
|
156
|
+
|
|
155
157
|
const routeFields = route[Object.keys(route)[0]].fields;
|
|
156
158
|
|
|
157
159
|
if (!openApi.paths[routeName][methodName]) {
|
|
@@ -165,7 +167,8 @@ class GetOpenApiJson extends AbstractCommand {
|
|
|
165
167
|
);
|
|
166
168
|
|
|
167
169
|
openApi.paths[routeName][methodName].summary = routeTitle;
|
|
168
|
-
openApi.paths[routeName][methodName].description =
|
|
170
|
+
openApi.paths[routeName][methodName].description =
|
|
171
|
+
routeDescriptionWithPermissions;
|
|
169
172
|
openApi.paths[routeName][methodName].parameters = [];
|
|
170
173
|
openApi.paths[routeName][methodName].security = securitySchemaNames;
|
|
171
174
|
|