4

I want to convert a JSON object written with json-api conventions into a Java object. I thought about using the katharsis library, but I couldn't see if it could be used for this purpose.

Does anyone have any idea how could I achieve this?

0

2 Answers 2

2

in a nutshell: yes, you can use Katharsis to convert Json-Objects which follow the Json:API conventions to Java Pojos!

The Katharsis Docs say: "The Katharsis library adds an additional layer on top of RESTful endpoint to provide easy HATEOAS support for Java by implementing JSON:API standard."

This Blog Post Json API in a Java web application is a step-by-step guide how you could achieve this.

Katharsis offers some example projects at their git hub page.

Let me know if you need a working example in spring-boot (1.3.0) with katharsis-spring.

Sign up to request clarification or add additional context in comments.

1 Comment

At the time I asked I don't think it was yet implemented. I figured it out though for what I needed back then. But thank you for your comment!
1

You can convert from json - java or from java - json with jackson reference

2 Comments

take a look at the link I provided (jsonapi.org). Jackson doesn't help me when talking about json-api conventions. There are the "relationships" key and the "included" key and I need something that can solve the binding between these two.
yes you are right , you have to create the model object by yourself , and this might need too much effort for no reason , if ill find anything related , ill post it , because i have the same problem with some large Json Objects , which have to be mapped in POJO models

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.