-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚫 Readonly properties of the models are not considered in the @requestBody. #126
Comments
Can you please post some code for a better understanding? |
This is the class i try to import : And I try to use with @requestBody, in this controller : `export default class AuthUserController {
|
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. |
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!
The text was updated successfully, but these errors were encountered: