Code Monkey home page Code Monkey logo

Comments (12)

DmytroMysak avatar DmytroMysak commented on May 14, 2024 4

Still having the same issue:

router:

  {
    path: '/private',
    module: PrivateModule,
  },
  {
    path: '/public',
    module: PublicModule,
    children: [
      {
        path: '/notifications',
        module: NotificationModule,
      },
    ],
  },
];

In swagger ui I have /notifications API instead of /public/notificatons
image

from nest-router.

shekohex avatar shekohex commented on May 14, 2024 3

Hi @mentos1386
the implementation of Nest RouterModule was missing in Swagger Package.
This PR nestjs/swagger#54 will solve the problem.
Thank again for reporting ❤️

from nest-router.

alexvanzyl avatar alexvanzyl commented on May 14, 2024 3

Thought this my be related.

I am having an issue with swagger generating routes with regards to nested resource, for example if I have the following routes:

export const routes: Routes = [
  {
    path: '/ninja',
    module: NinjaModule,
    children: [
        { path: ':ninjaId/cats', module: CatsModule },
    ],
  },
];

The generated swagger document will generate the following route where ninjaId is the parent id:

GET ​/ninja​/:ninjaId​/cats

In order to work correctly with the swagger UI what it should generate is the below route (Notice the curly brackets):

GET ​/ninja​/{ninjaId​}/cats

Any ideas?

My dependencies are:

"dependencies": {
    "@nestjs/common": "^6.0.0",
    "@nestjs/core": "^6.0.0",
    "@nestjs/platform-express": "^6.0.0",
    "@nestjs/platform-fastify": "^6.0.1",
    "@nestjs/swagger": "^3.0.1",
    "class-transformer": "^0.2.0",
    "class-validator": "^0.9.1",
    "fastify-swagger": "^2.3.2",
    "nest-router": "^1.0.9",
    "nestjs-config": "^1.3.21",
    "reflect-metadata": "^0.1.12",
    "rimraf": "^2.6.2",
    "rxjs": "^6.3.3"
  },
  "devDependencies": {
    "@types/express": "^4.16.0",
    "@types/jest": "^23.3.13",
    "@types/node": "^10.12.18",
    "@types/supertest": "^2.0.7",
    "@nestjs/testing": "^6.0.0",
    "jest": "^23.6.0",
    "nodemon": "^1.18.9",
    "prettier": "^1.15.3",
    "supertest": "^3.4.1",
    "ts-jest": "^23.10.5",
    "ts-node": "^7.0.1",
    "tsconfig-paths": "^3.7.0",
    "tslint": "5.12.1",
    "typescript": "^3.2.4"
  },

from nest-router.

shekohex avatar shekohex commented on May 14, 2024

it is ok now
closing.

from nest-router.

Joel-Raju avatar Joel-Raju commented on May 14, 2024

I'm facing the same problem as @alexvanzyl

from nest-router.

shekohex avatar shekohex commented on May 14, 2024

@Joel-Raju @alexvanzyl any minimal repository to reproduce that behavior?
I will reopen that issue.

from nest-router.

Joel-Raju avatar Joel-Raju commented on May 14, 2024

@shekohex checkout this example https://github.com/Joel-Raju/nest-router/tree/master/examples/heroes

see the endpoint generated by swagger for /heroes/:heroId/powers

from nest-router.

shekohex avatar shekohex commented on May 14, 2024

@Joel-Raju @alexvanzyl the hot fix is on its way nestjs/swagger#253 😃

from nest-router.

shekohex avatar shekohex commented on May 14, 2024

@Joel-Raju @alexvanzyl it dose not seem to be a hot fix at all 😂 , it just got merged now
please once a new version of @nestjs/swagger package get published, give it another try, so i can close this issue.

thanks :)

from nest-router.

steven274 avatar steven274 commented on May 14, 2024

I have the same problem with DmytroMysak

from nest-router.

chriskuech avatar chriskuech commented on May 14, 2024

@shekohex this appears to still be an issue

from nest-router.

francorosatti avatar francorosatti commented on May 14, 2024

Hi @chriskuech

@shekohex this appears to still be an issue

I fix it by moving from the nest-router external package to the one included in @nestjs/core as explained in the readme of this project:

As of Nestjs v8.0.0 This module got added into the @nestjs/core. see the docs with that being said, this package is still maintained (for now).

from nest-router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.