Open abdel7517 opened 2 months ago
Can you please post some code for a better understanding?
This is the class i try to import :
export default class CreateUserDto { constructor( readonly name: string, readonly firstName: string, readonly email: string, readonly companyId: UUID, readonly password: string, readonly phone: string ) {} }
And I try to use with @requestBody, in this controller :
`export default class AuthUserController { constructor(private authUserUseCase: AuthUserUseCase) {} /**
May I ask, why not use a model or validator instead, since this is the adonisJS-way of doing these things?
Thank you for your response. I am using a hexagonal architecture, so I handle all business constraints, including payload validation, in the domain layer of the application (where all my business logic resides). I could manage this in the controller, but it would be redundant work. However, I have already analyzed your package and modified it locally to include the readonly properties. Is it possible to make a PR?
I assume that the add-on is very busy, so while waiting for a response, for those who have the same need as I do, here is a modified version of the package that accepts both readonly props and props with a default value (e.g., size: number = 30). This is because these types of variables are not handled in the current version. https://www.npmjs.com/package/auto-swagger-adonis-abd
Hello, is it possible to include readonly properties for models? I have a class that I'm using as a requestBody, specified with the @requestBody decorator, but the readonly properties do not appear in Swagger-UI. Thank you!