GithubHelp home page GithubHelp logo

Comments (6)

bryce-anderson avatar bryce-anderson commented on July 22, 2024

I've made some progress, but I'm not sure how far it goes to the real deal. It seems pretty obvious to me that if you're going to return multiple status codes, you're going to want to return multiple types of responses so the progress is only a minor improvement.

from rho.

bryce-anderson avatar bryce-anderson commented on July 22, 2024

I don't think things are going to get much better than this using standard function return types. I've previously done some work using others types to wrap the result such as a scalaz disjunction \/ and the stdlib Option types here which is the only obvious (to me at least) way forward. Perhaps things like the scalaz Validation will grow along those same lines.

I'm certainly willing to entertain other ideas, but I'm going to shelve this for a while until inspiration comes.

from rho.

arouel avatar arouel commented on July 22, 2024

I agree with you that being bound to the same result type (e.g. String or JValue) is only a minor improvement. At the end we want the concrete types that could potentially be returned to document it with SwaggerSupport.

from rho.

arouel avatar arouel commented on July 22, 2024

I would also bring into discussion if our already existing disjunction could extended by using a level in between the Status types.

scalaz.\/[ClientError[Message],Success[Pet]]
So we can group like this:

  • Informational (1xx)
  • Success (2xx)
  • Redirection (3xx)
  • Error (4xx or 5xx)
    • ClientError (4xx)
    • ServerError (5xx)

from rho.

arouel avatar arouel commented on July 22, 2024

After thinking a bit I think a super type that covers the disjunction of N result types could match also our needs.

from rho.

bryce-anderson avatar bryce-anderson commented on July 22, 2024

This issue is closed by 8249c8b.

from rho.

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.