Skip to content

Commit f15c246

Browse files
Artem Ivanovjs2me
Artem Ivanov
authored andcommitted
fix: onCreateRoute skip behaviour
1 parent a505c79 commit f15c246

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/schema-parser/schema-routes.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -872,19 +872,21 @@ class SchemaRoutes {
872872
_.forEach(routeInfosMap, (routeInfo, method) => {
873873
const parsedRouteInfo = this.parseRouteInfo(rawRouteName, routeInfo, method, usageSchema, parsedSchemas);
874874
const processedRouteInfo = this.config.hooks.onCreateRoute(parsedRouteInfo);
875-
const route = processedRouteInfo || parsedRouteInfo;
876-
877-
if (!this.hasSecurityRoutes && route.security) {
878-
this.hasSecurityRoutes = route.security;
879-
}
880-
if (!this.hasQueryRoutes && route.hasQuery) {
881-
this.hasQueryRoutes = route.hasQuery;
875+
if (processedRouteInfo !== false) {
876+
const route = processedRouteInfo || parsedRouteInfo;
877+
878+
if (!this.hasSecurityRoutes && route.security) {
879+
this.hasSecurityRoutes = route.security;
880+
}
881+
if (!this.hasQueryRoutes && route.hasQuery) {
882+
this.hasQueryRoutes = route.hasQuery;
883+
}
884+
if (!this.hasFormDataRoutes && route.hasFormDataParams) {
885+
this.hasFormDataRoutes = route.hasFormDataParams;
886+
}
887+
888+
this.routes.push(route);
882889
}
883-
if (!this.hasFormDataRoutes && route.hasFormDataParams) {
884-
this.hasFormDataRoutes = route.hasFormDataParams;
885-
}
886-
887-
this.routes.push(route);
888890
});
889891
});
890892
};

0 commit comments

Comments
 (0)