Doesn't pickup nested routes in SwaggerUI (OpenApiSpex)

I have nested routes in router.ex file but It doesn’t show up in localhost:4000/swaggerui
I couldn’t figure out why this happens.

campaign_path  POST    /api/posts/preview                                                        DashboardApiWeb.Posts.PostController :send_post_preview
                        post_path  GET     /api/posts                                                                DashboardApiWeb.Posts.PostController :index
                        post_path  GET     /api/posts/:id                                                            DashboardApiWeb.Posts.PostController :show
                        post_path  POST    /api/posts                                                                DashboardApiWeb.Posts.PostController :create
                       post_path  PATCH   /api/posts/:id                                                            DashboardApiWeb.Posts.PostController :update
                                       PUT     /api/posts/:id                                                            DashboardApiWeb.Posts.PostController :update
                        post_path  DELETE  /api/posts/:id                                                            DashboardApiWeb.Posts.PostController :delete
       post_post_contact_path  POST    /api/posts/:post_id/posts_contacts                                DashboardApiWeb.Posts.PostContactController :filter
               post_post_path  POST    /api/posts/:post_id/duplicate                                         DashboardApiWeb.Posts.PostController :duplicate
       post_post_trigger_path  POST    /api/posts/:post_id/post_trigger/trigger                          DashboardApiWeb.Posts.PostTriggerController :create
       post_post_trigger_path  PATCH   /api/posts/:post_id/post_trigger/trigger/:id                      DashboardApiWeb.Posts.PostTriggerController :update
                                       PUT     /api/posts/:post_id/post_trigger/trigger/:id                      DashboardApiWeb.Posts.PostTriggerController :update
       post_post_trigger_path  DELETE  /api/posts/:post_id/post_trigger/trigger/:id                      DashboardApiWeb.Posts.PostTriggerController :delete
                        post_path  GET     /api/posts/contact/:contact_id                                            DashboardApiWeb.Posts.PostController :list_contact_posts
                        post_path  POST    /api/posts/messages_count                                                 DashboardApiWeb.Posts.PostController :messages_count
                        post_path  POST    /api/posts/audience       

This is output from mix phx.routes

and in localhost:4000/swaggerui I am looking for trigger endpoint

post_post_trigger_path  POST    /api/posts/:post_id/post_trigger/trigger                         DashboardApiWeb.Posts.PostTriggerController :create
post_post_trigger_path  PATCH   /api/posts/:post_id/post_trigger/trigger/:id                      DashboardApiWeb.Posts.PostTriggerController :update
post_post_trigger_path  DELETE  /api/posts/:post_id/post_trigger/trigger/:id                      DashboardApiWeb.Posts.PostTriggerController :delete

I am using OpeApiSpex
Any advices? or hints?

Can you show your code for this?

Thanks for reply, here is code in router.ex

 scope "/", Posts do
      resources("/posts", PostController, except: [:new, :edit]) do
        post("/posts_contacts", PostContactController, :filter)
        post("/duplicate", PostController, :duplicate)
        resources("/post_trigger/trigger", PostTriggerController,
          only: [
            :create,
            :update,
            :delete
          ]
        )
      end

      scope "/posts" do
        get("/contact/:contact_id", PostController, :list_contact_posts)
        post("/messages_count", PostController, :messages_count)
        post("/audience", PostController, :audience)
      end
    end

I never knew you can nest define scopes. While this feature is nice to have, you can easily refactor this to non-nested variant, IMO the generic variant is 10 times more readable.