Giter Club home page Giter Club logo

Comments (6)

ziftytodd avatar ziftytodd commented on August 27, 2024 29

For anyone else hitting this error, if you still want to return a true HATEOAS resource (versus a straight-up Collection), change the @RequestMapping on the readBookmarks method to include a produces attribute:

@RequestMapping(method = RequestMethod.GET, produces = {MediaType.APPLICATION_JSON_VALUE, "application/hal+json"})

Don't forget to import import org.springframework.http.MediaType;

from tut-rest.

LeonardGC avatar LeonardGC commented on August 27, 2024 4

@jflewis I did the tutorial just now and was glad to find this page to solve this issue. The fix of @ziftytodd should be implemented asap.
There are other issues with this tutorial as well, like the pointing to the wrong source code (at the start of the tutorial), the addition of the org.springframework.security.oauth dependency from the beginning, (so the examples don't work but are asking for a username and password), etc...
Very confusing.

from tut-rest.

darrylb-github avatar darrylb-github commented on August 27, 2024 1

This seems to be related to Resources<BookmarkResource> readBookmarks. Changing this to Collection<BookmarkResource> readBookmarks and returning the list without the resources wrapper seems to fix it for me. I'll close this as its probably something to do with my setup.

from tut-rest.

ievgen-kapinos avatar ievgen-kapinos commented on August 27, 2024

Helped for me too. TNX. A lot of typo I've found in this tutorial. So seems it is correct fix.

from tut-rest.

jflewis avatar jflewis commented on August 27, 2024

Is this happening for everyone because I've run into the same issue. Should the above fix by @ziftytodd be implemented? Sorry to bring up a 2 year old issue

from tut-rest.

cal0610 avatar cal0610 commented on August 27, 2024

It would also be interesting to see how to test methods readSingleBookmark and readBookmarks after using hateoas links...

from tut-rest.

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.