Code Monkey home page Code Monkey logo

api-docs's People

Contributors

andreyco avatar grischka avatar israelortuno avatar jasonlewis avatar mentos1386 avatar nauxliu avatar roquie avatar sorora avatar vanbrabantf avatar yuters avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

api-docs's Issues

Mention some Laravel specific incompatibilities in the wiki

Originally posted over at dingo/api dingo/api#655
I want to send a Pull Request, but I just want to make sure that it's fine

Hi,

I've been using dingo/api in many applications and I noticed that users of dingo/api might need to know about the following issues in the wiki (and maybe at least about their workarounds or a link to the github issue):

  • Form Validation breaks routing - I know this is mentioned in the docs for Exceptions, but the solution is not. This might be the solution (I tried it and it works)
  • withoutMiddleware in tests returns 404 - This is something that can't be fixed, but I think it's worth noting. #571

This is the only thing mentioned in the wiki page

The API will generally work with all other packages, however, some Laravel specific packages may conflict with the API as it integrates itself heavily with the Laravel router to provide the needed functionality.

Let me know what you think!

Error response shouldn't use return

In Wiki: Responding With An Error it states:

return $this->response->errorUnauthorized();

However, all the method does is throws an error. The method itself has no return statement. Isn't the return redundant?

Consider the following controller method as example. If a return is added to the errorResponse, it does nothing except adds a warning to the IDE because there's a conflict between return void and the declared return type. (Adding |void to @return causes a warning too.)

/**
 * Display the specified resource.
 *
 * @param  \App\Letter $letter
 * @return \Dingo\Api\Http\Response
 */
public function show(Letter $letter)
{
    /** @var User $user */
    $user = $this->auth->user();
    if( $user->cannot('view', $letter) ) {
        $this->response->errorUnauthorized();
    }

    return $this->response->item($letter, new LetterTransformer);
}

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.