Coder Social home page Coder Social logo

Comments (9)

alexsuperdev avatar alexsuperdev commented on September 17, 2024 1

Hi @RohanNagar. I would like to take this issue on. You wrote pretty well what you want to be done.

from thunder.

alexsuperdev avatar alexsuperdev commented on September 17, 2024 1

I had a little trouble, but after a while i suceeded with fork and push, thanks

from thunder.

RohanNagar avatar RohanNagar commented on September 17, 2024

I have an idea of how to do this, so sync with me if you want to take this issue on.

Basically, move the logic to the RequestValidator class, create overloading methods

validateRequest(User user)

validateRequest(String email, String password)

validateRequest(String email, String password, User user)

These methods do the validation and if something is invalid, throw a ValidationException. The exception has a method to buildResponse(String requestType) and it will build the proper response (status code and response body) for the validation issue.

The resource methods can then call validateRequest and catch the exception, and return the result of buildResponse.

from thunder.

RohanNagar avatar RohanNagar commented on September 17, 2024

@alexsuperdev please do! Feel free to let me know if you have any questions!

from thunder.

alexsuperdev avatar alexsuperdev commented on September 17, 2024

@RohanNagar can you send me your formatter configuration if you use eclipse? I have already 630 Checkstyle violations founded by maven-checkstyle-plugin :)

from thunder.

RohanNagar avatar RohanNagar commented on September 17, 2024

@alexsuperdev Haha wow that's a lot! I actually use IntelliJ, not Eclipse. Perhaps you can try to create a formatter configuration from the Checkstyle configuration? See here for a possible answer on how to do it: https://stackoverflow.com/questions/984778/how-to-generate-an-eclipse-formatter-configuration-from-a-checkstyle-configurati

The Checkstyle configuration is the checkstyle.xml file in the root.

from thunder.

alexsuperdev avatar alexsuperdev commented on September 17, 2024

@RohanNagar I have done this issue locally and also corrected Checkstyle violations :) I could push my branch or attach here the classes for review

from thunder.

RohanNagar avatar RohanNagar commented on September 17, 2024

@alexsuperdev great! You can go ahead and create a pull request with your changes and I can review.

from thunder.

RohanNagar avatar RohanNagar commented on September 17, 2024

Also let me know if you need help getting that up. You should be able to fork the repo, push to a branch on your fork, and then create the PR in Github (from your fork to this repo).

from thunder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.