{"action":"created","issue":{"url":"https://api.github.com/repos/katharsis-project/katharsis-core/issues/74","labels_url":"https://api.github.com/repos/katharsis-project/katharsis-core/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/katharsis-project/katharsis-core/issues/74/comments","events_url":"https://api.github.com/repos/katharsis-project/katharsis-core/issues/74/events","html_url":"https://github.com/katharsis-project/katharsis-core/issues/74","id":101957429,"number":74,"title":"Using ObjectMapper as a standalone","user":{"login":"corrspt","id":789263,"avatar_url":"https://avatars.githubusercontent.com/u/789263?v=3","gravatar_id":"","url":"https://api.github.com/users/corrspt","html_url":"https://github.com/corrspt","followers_url":"https://api.github.com/users/corrspt/followers","following_url":"https://api.github.com/users/corrspt/following{/other_user}","gists_url":"https://api.github.com/users/corrspt/gists{/gist_id}","starred_url":"https://api.github.com/users/corrspt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corrspt/subscriptions","organizations_url":"https://api.github.com/users/corrspt/orgs","repos_url":"https://api.github.com/users/corrspt/repos","events_url":"https://api.github.com/users/corrspt/events{/privacy}","received_events_url":"https://api.github.com/users/corrspt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-19T17:48:07Z","updated_at":"2015-08-21T17:02:22Z","closed_at":null,"body":"Hey, first of all I'd like to thank you guys for the effort on the Library.\r\n\r\nI'm playing with a Play Framework app (Play 2.4.2). And I was trying to integrate Katharsis (0.9.3) with it but I can't seem to figure the way I should do it from the examples.\r\n\r\nIn that sense I thought that maybe I could just use whatever you guys do with the Jackson library to get the behavior I want as a standalone. I've found a [test which seemed to be exactly](https://github.com/katharsis-project/katharsis-core/blob/a809dc472d25ebac34cf0d302003017d2fe175d8/src/test/java/io/katharsis/jackson/BaseSerializerTest.java) what I've wanted but when I tried it in a simple Java main, it does not spit out a JSONAPI compatible JSON, but a regular JSON.\r\n\r\n```java\r\nObjectMapper sut = null;\r\n\t\t\r\nResourceRegistryBuilder registryBuilder = new ResourceRegistryBuilder(new SampleJsonServiceLocator(), new ResourceInformationBuilder());\r\nResourceRegistry resourceRegistry = registryBuilder.build(\"test.models\", \"http://localhost:9000/api\");\r\n\r\nJsonApiModuleBuilder jsonApiModuleBuilder = new JsonApiModuleBuilder();\r\n\r\n sut = new ObjectMapper();\r\n sut.registerModule(jsonApiModuleBuilder.build(resourceRegistry));\r\n               \r\n PostJSON p = new PostJSON();\r\n p.setId(\"someId\");\r\n p.setName(\"Some Name\");\r\n        \r\nEntityJSON j = new EntityJSON();\r\nj.setId(UUID.randomUUID());\r\nj.setName(\"John\");\r\nj.setPost(p);\r\n        \r\nSystem.out.println(sut.writeValueAsString(j));\r\n\r\n```\r\n\r\nDo notice that my EntityJSON.java file is annotated (correctly I hope)\r\n\r\n```java\r\n@JsonApiResource(type = \"entities\")\r\npublic class EntityJSON {\r\n\t\r\n\t@JsonApiId\r\n\tprivate UUID id;\r\n\t\r\n\tprivate String name;\r\n\r\n    //getters and setters\r\n}\r\n```\r\n\r\nI did, however find that if I changed my println to \r\n```java\r\nRequestParams req = new RequestParams(sut);\r\nSystem.out.println(sut.writeValueAsString(new Container(j,req)));\r\n```\r\nI get\r\n```json\r\n{\r\n  \"type\": \"entities\",\r\n  \"id\": \"6f510d4d-321a-4c6e-bd5b-4a9e24eaa71a\",\r\n  \"attributes\": {\r\n    \"name\": \"John\"\r\n  },\r\n  \"relationships\": {\r\n    \"post\": {\r\n      \"links\": {\r\n        \"self\": \"http://localhost:9000/api/entities/6f510d4d-321a-4c6e-bd5b-4a9e24eaa71a/relationships/post\",\r\n        \"related\": \"http://localhost:9000/api/entities/6f510d4d-321a-4c6e-bd5b-4a9e24eaa71a/post\"\r\n      },\r\n      \"data\": {\r\n        \"type\": \"posts\",\r\n        \"id\": \"batata\"\r\n      }\r\n    }\r\n  },\r\n  \"links\": {\r\n    \"self\": \"http://localhost:9000/api/entities/6f510d4d-321a-4c6e-bd5b-4a9e24eaa71a\"\r\n  }\r\n}\r\n```\r\n\r\nThat it does indeed to what I want :) But I wanted to know a few things\r\n\r\n* Can I get rid of the \"links\"? section\r\n* Is there a better way of doing this as a standalone? Should I use the container, that requires the \"RequestParameters\"\r\n* Do I really need to implement the resourceRepository interface? It just needs to exits apparently (all my methods returning null seem to do the trick)\r\n* Would there be a way to integrate with the Play framework? Or maybe having a core-module that Just does the JSONAPI parsing/serializing and then having other projects that do the dropwizard, wildfly integration?\r\n\r\nThanks in advance :+1: "},"comment":{"url":"https://api.github.com/repos/katharsis-project/katharsis-core/issues/comments/133495256","html_url":"https://github.com/katharsis-project/katharsis-core/issues/74#issuecomment-133495256","issue_url":"https://api.github.com/repos/katharsis-project/katharsis-core/issues/74","id":133495256,"user":{"login":"meshuga","id":1073936,"avatar_url":"https://avatars.githubusercontent.com/u/1073936?v=3","gravatar_id":"","url":"https://api.github.com/users/meshuga","html_url":"https://github.com/meshuga","followers_url":"https://api.github.com/users/meshuga/followers","following_url":"https://api.github.com/users/meshuga/following{/other_user}","gists_url":"https://api.github.com/users/meshuga/gists{/gist_id}","starred_url":"https://api.github.com/users/meshuga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meshuga/subscriptions","organizations_url":"https://api.github.com/users/meshuga/orgs","repos_url":"https://api.github.com/users/meshuga/repos","events_url":"https://api.github.com/users/meshuga/events{/privacy}","received_events_url":"https://api.github.com/users/meshuga/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T17:02:22Z","updated_at":"2015-08-21T17:02:22Z","body":"2. I mean http://jsonapi.org/format/#document-compound-documents and http://jsonapi.org/format/#fetching-includes - you can specify to add custom resources\r\n3. See https://github.com/katharsis-project/katharsis-core/issues/70 :) \r\nI think soon version 0.9.4 should be released, but first I'd like to close https://github.com/katharsis-project/katharsis-core/issues/53 "}}