#Swagger integration issues

12 messages · Page 1 of 1 (latest)

silk marlin
#

So recently i ran into some weird issues using swagger:

On my laptop registering the plugin in the nest config generated the schemas properly for all .dto.ts and .entity.ts files but once i tried it on my desktop computer it stopped working and now i need to annotate each property using @frigid wharfProperty().

Config:

{
  "$schema": "https://json.schemastore.org/nest-cli",
  "collection": "@nestjs/schematics",
  "sourceRoot": "src",
  "deleteOutDir": true,
  "compilerOptions": {
    "plugins": [
      {
        "name": "@nestjs/swagger",
        "options": {
          "classValidatorShim": false,
          "introspectComments": true
        }
      }
    ]
  }
}
storm raven
#

see the output of npx nest info on both environments

silk marlin
#

Only difference is one is using nodejs version 19.9.0 (one that works) and the other is using 20.4.0

storm raven
#

what about the OS?

silk marlin
#

both using windows 10

#

Can't test on my ubuntu until monday

silk marlin
#

Downgraded my desktop pc to node 19.9.0 and still no luck

storm raven
#

I've no ideia on what's going on

#

can share the output of npx nest info?

silk marlin
#
[System Information]
OS Version     : Windows 10
NodeJS Version : v19.9.0
NPM Version    : 9.6.3     

[Nest CLI]
Nest CLI Version : 10.1.18 

[Nest Platform Information]
platform-express version : 10.2.6
schematics version       : 10.0.2
throttler version        : 5.0.0 
passport version         : 10.0.2
swagger version          : 7.1.13
typeorm version          : 10.0.0
testing version          : 10.2.6
common version           : 10.2.6
config version           : 3.1.1
bull version             : 10.0.1
core version             : 10.2.6
jwt version              : 10.1.1
cli version              : 10.1.18
#

Just fully deleted my dist folder and ran it in dev mode and it worked

#

Although i have another question, can i define a response schema for each endpoint without creating a dto/entity for it? For example have it based off my typescript return type?