swagger-node-runner icon indicating copy to clipboard operation
swagger-node-runner copied to clipboard

Assertion error on register

Open phil-warner opened this issue 7 years ago • 6 comments

Hi

I'm using swagger-restify-mw and when I start my app I get the following error. It's not obvious to me what the problem is, but I thought it might be to others.

AssertionError: The first character of a path should be `/` or `*`
    at Router.on (/opt/bitnami/apps/smsWorks/sms-works/node_modules/find-my-way/index.js:44:3)
    at RouterRegistryRadix.add (/opt/bitnami/apps/smsWorks/sms-works/node_modules/restify/lib/routerRegistryRadix.js:42:21)
    at Router.mount (/opt/bitnami/apps/smsWorks/sms-works/node_modules/restify/lib/router.js:167:20)
    at Server.serverMethod [as del] (/opt/bitnami/apps/smsWorks/sms-works/node_modules/restify/lib/server.js:1476:33)
    at /opt/bitnami/apps/smsWorks/sms-works/node_modules/swagger-node-runner/lib/restify_middleware.js:23:18
    at Array.forEach (native)
    at Middleware.register (/opt/bitnami/apps/smsWorks/sms-works/node_modules/swagger-node-runner/lib/restify_middleware.js:22:17)
    at /opt/bitnami/apps/smsWorks/sms-works/app.js:86:24
    at /opt/bitnami/apps/smsWorks/sms-works/node_modules/swagger-restify-mw/lib/index.js:32:5
    at /opt/bitnami/apps/smsWorks/sms-works/node_modules/swagger-node-runner/index.js:234:7

phil-warner avatar May 14 '18 14:05 phil-warner

Some extra information. I'm using Restify 7 on Node 8, with Swagger Node Runner 0.7.3.

phil-warner avatar May 15 '18 09:05 phil-warner

More information... This looks like an incompatibility with Restify 7, which uses find-my-way for routing purposes. I downgraded to Restify 6.4.0, which fixed the issue.

phil-warner avatar May 15 '18 15:05 phil-warner

Thanks! This is good to know.

theganyo avatar May 15 '18 16:05 theganyo

Thanks!

luisbilecki avatar Jun 18 '18 12:06 luisbilecki

Can we get this fixed?

phil-warner avatar Oct 24 '20 15:10 phil-warner

I resolved this by downgrading to v6.4.0

prachikhadke avatar Nov 07 '22 22:11 prachikhadke