Thank you this tutorial works great. I had a question. I’ve been trying to convert this code to using Gradel but it seems the Gradel version of the plug-in doesn’t support delegatepattern?
How to handle with ResponseBodyAdvice interface when return unified response body? Instead of return UserDTO as video show, I'd like to return ResultDTO which contains a 'statusCode' and a 'data' fields
Bro What If I have very Huge UserDTO which contain multiple other Dtos also internally. How can I define that schema? And also is there any way so that we no need to define that schema rather I will give some path in $ref and takes schema definition from that external path?
I showed in the video how you can add validation on fields like first name, last name and email. When the DTO is generated the @Valid annotation will be added to the field.
And also please explain more about plugins How can I modify the plugins so that I will be able to generate project based on my requirement. please explain use case of each tag in the plugin
The package that you have mentioned in apiPackage and modelPackage should be the same as your Spring Application package. Else add all required packages as basePackages for componentScan. Check if that resolves the problem
@@devproblems thank you for your response the issue was resolved, and now one request can you please make a video on 'AsyncAPI Generator through spring boot'
Validation errors min and max lengths instead of logging those in backend console logs can we get those in swagger UI error response the actual validation errors? Example error like [nio-8080-exec-2] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.bind.MethodArgumentNotValidException: Validation failed for argument [0] in public default org.springframework.http.ResponseEntity com.openapi.gen.springboot.api.UserApi.saveUser(com.openapi.gen.springboot.dto.UserDTO): [Field error in object 'userDTO' on field 'firstName': rejected value [sanjayadfsssssssssssssssssssadsfdafsdf]; codes [Size.userDTO.firstName,Size.firstName,Size.java.lang.String,Size]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [userDTO.firstName,firstName]; arguments []; default message [firstName],15,3]; default message [size must be between 3 and 15]] ]
Hi Sanjay for getting the validation errors on swagger UI you have to create a controlleradvice class with a methods annotated with MethodArgumentNotValidation Exception in that method you can enhance your error or pass as it is to the UI like how I did for UserNotFoundException in the video.
Hi Sarang, This is really a great video. you explained it very well. Thanks buddy.😊
Спасибо друг, долго не мог разобраться, теперь все понятно, удачи тебе во всем)
Thank you so much, bro! It was very helpful!
Great walkthrough, thanks for this video.
Thank you this tutorial works great. I had a question. I’ve been trying to convert this code to using Gradel but it seems the Gradel version of the plug-in doesn’t support delegatepattern?
Do you store the DTO in the database or would you still manually create models and add the annotations for JPA entities? To use Hibernate.
DTO are generated. The entities need to be created manually.
Awesome details!!
How to handle with ResponseBodyAdvice interface when return unified response body? Instead of return UserDTO as video show, I'd like to return ResultDTO which contains a 'statusCode' and a 'data' fields
Bro What If I have very Huge UserDTO which contain multiple other Dtos also internally.
How can I define that schema?
And also is there any way so that we no need to define that schema rather I will give some path in $ref and takes schema definition from that external path?
Hi, how can I add validation in yml file so when I build the project validation annotation will be added in generated dto class
I showed in the video how you can add validation on fields like first name, last name and email. When the DTO is generated the @Valid annotation will be added to the field.
And also please explain more about plugins
How can I modify the plugins so that I will be able to generate project based on my requirement.
please explain use case of each tag in the plugin
help, how can i do the same with gradle ??
Follow these steps to convert maven build to gradle
www.baeldung.com/maven-convert-to-gradle
Please reply me, I'm have worked to 10:54 but Swagger-UI not found my API generated. Please support. Tks
The package that you have mentioned in apiPackage and modelPackage should be the same as your Spring Application package. Else add all required packages as basePackages for componentScan. Check if that resolves the problem
Nice job
Great ! thanks
Thanks for watching. And don't forget to subscribe :)
swagger ui relay on v3/api-docs not on what u specied on the yaml file u created
Yaml is for writing API definitions used by generator to generate code, it has nothing to do with swagger-ui.
bro instead of writing by manually, try to implement it with stoplight with one video that's great
Issue: UserApiDelegate is not accessable from the userDelegateIml class
Please help
If you can see the class in the target folder and it is not accessible when you import then refresh the project.
@@devproblems thank you for your response the issue was resolved, and now one request can you please make a video on 'AsyncAPI Generator through spring boot'
thank you !!
good video
Good video and content but not audible clearly
Sorry for the inconvenience. Hope you got the answers to your doubts by watching the video.
@@devproblems Yes Thank You very much 🤝
Validation errors min and max lengths instead of logging those in backend console logs can we get those in swagger UI error response the actual validation errors? Example error like [nio-8080-exec-2] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.bind.MethodArgumentNotValidException: Validation failed for argument [0] in public default org.springframework.http.ResponseEntity com.openapi.gen.springboot.api.UserApi.saveUser(com.openapi.gen.springboot.dto.UserDTO): [Field error in object 'userDTO' on field 'firstName': rejected value [sanjayadfsssssssssssssssssssadsfdafsdf]; codes [Size.userDTO.firstName,Size.firstName,Size.java.lang.String,Size]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [userDTO.firstName,firstName]; arguments []; default message [firstName],15,3]; default message [size must be between 3 and 15]] ]
Hi Sanjay for getting the validation errors on swagger UI you have to create a controlleradvice class with a methods annotated with MethodArgumentNotValidation Exception in that method you can enhance your error or pass as it is to the UI like how I did for UserNotFoundException in the video.