Flutterando / shelf_swagger_ui

Swagger UI plugin for Shelf

Home Page:https://pub.dev/packages/shelf_swagger_ui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

APIs not getting listed in pipelined router

binupa opened this issue · comments

I already have a my shelf Router router with multiple routes. I tried to cascade SwaggerUI as handler. However, none of my API routes are getting listed in swagger UI. Please assist. The documentation provided does not cover such scenarios

    var staticHandler =
        createStaticHandler('wwwroot', defaultDocument: 'index.html');
    return Pipeline()
        .addMiddleware(corsHeaders())
        //.addHandler(router);
        .addHandler(Cascade()
            .add(router)
            .add(staticHandler)
            .add(SwaggerUI('wwwroot/swagger.yaml',
                title: 'MyApp API Doc'))
            .handler);
openapi: 3.0.0
info:
  description: "API Test"
  version: "1.0.0"
  title: "MyApp API"
servers:
  - url: http://localhost:8080
    description: "MyApp Server"
tags:
  - name: "/api/users"
    description: "User resource"