You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When using adonis-autoswagger in an AdonisJS v6 project, validators (app/validators/*.ts) are not included in the generated Swagger schemas when running the server in HMR mode (node ace serve --hmr). However, models (app/models/*.ts) are correctly generated in both watch and HMR modes.
Steps to Reproduce:
Install adonis-autoswagger in an AdonisJS 6 project.
import{createPostValidator}from'#validators/post'exportdefaultclassUsersController{/** * @tag User * @summary Create a new user * @requestBody <createPostValidator> * @responseBody 200 - {"message": "User created"} */publicasyncpostUser({ request, response }: HttpContext): Promise<void>{constpayload=awaitcreatePostValidator.validate(request.all())response.json({message: 'User created'})}}
Run the following commands and check the Swagger UI (http://localhost:3333/docs):
✅ node ace docs:generate (Schemas are correctly generated)
✅ node ace serve --watch (Schemas are correctly generated)
❌ node ace serve --hmr (Validators are missing from Swagger schemas, but models still appear)
Expected Behavior:
Validators (app/validators/*.ts) should be included in Swagger schemas when running the server in HMR mode (node ace serve --hmr), just like they are when using node ace serve --watch.
Actual Behavior:
Models (app/models/*.ts) are detected and included in schemas correctly.
Validators (app/validators/*.ts) are missing in HMR mode but work fine in Watch mode.
Swagger UI (http://localhost:3333/docs) throws the following error in HMR mode:
Errors
Resolver error at paths./user.post.requestBody.content.application/json.schema.$ref
Could not resolve reference: Could not resolve pointer: /components/schemas/createPostValidator does not exist in document
Debug logs show that validators are found but not processed:
Found model files [
'C:\\Users\\leogu\\Desktop\\Projects\\hello-world\\app/models/user.ts'
]
Found interfaces files []
Found validator files [
'C:\\Users\\leogu\\Desktop\\Projects\\hello-world\\app/validators/post.ts'
]
**You are probably using 'node ace serve --hmr', which is not supported yet. Use 'node ace serve --watch' instead.**
Node C:\Users\leogu\Desktop\Projects\hello-world\app\validators\post.ts does not exist
Environment:
AdonisJS Version: 6.17.1
adonis-autoswagger Version: 3.64.0
Node.js Version: 22.13.1
Operating System: Windows 11 WSL 2
The text was updated successfully, but these errors were encountered:
Description:
When using
adonis-autoswagger
in an AdonisJS v6 project, validators (app/validators/*.ts
) are not included in the generated Swagger schemas when running the server in HMR mode (node ace serve --hmr
). However, models (app/models/*.ts
) are correctly generated in both watch and HMR modes.Steps to Reproduce:
Install
adonis-autoswagger
in an AdonisJS 6 project.Add a validator file, for example:
Reference the validator in a controller:
Run the following commands and check the Swagger UI (
http://localhost:3333/docs
):node ace docs:generate
(Schemas are correctly generated)node ace serve --watch
(Schemas are correctly generated)node ace serve --hmr
(Validators are missing from Swagger schemas, but models still appear)Expected Behavior:
Validators (
app/validators/*.ts
) should be included in Swagger schemas when running the server in HMR mode (node ace serve --hmr
), just like they are when usingnode ace serve --watch
.Actual Behavior:
app/models/*.ts
) are detected and included in schemas correctly.app/validators/*.ts
) are missing in HMR mode but work fine in Watch mode.http://localhost:3333/docs
) throws the following error in HMR mode:Environment:
The text was updated successfully, but these errors were encountered: