ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. * mindCrime joined #java
  2. * PocketKiller joined #java
  3. * handicraftsman joined #java
  4. * michele joined #java
  5. * mindCrime joined #java
  6. * kcomhnall joined #java
  7. * mindCrime joined #java
  8. * raj joined #java
  9. * yaboishady2 joined #java
  10. * wodencafe joined #java
  11. * ChaiTRex joined #java
  12. * Inline joined #java
  13. * five618480339176 joined #java
  14. deebo anyone happen to use spring-data-rest? is there some existing class in some spring library for deserializing json from the "weird" { "_embedded": { "resultTypes": [...] } response?
  15. deebo -> config.useHalAsDefaultJsonMediaType(false) -> everyone started clapping
  16. Para ~gpt summarize what jackson's config.useHalAsDefaultJsonMediaType means and what does it do in context of spring-data-rest, including what is "hal"
  17. javabot In Spring Data REST, Jackson's `config.useHalAsDefaultJsonMediaType` is a configuration property that sets 'HAL' as the default media type for JSON responses. 'HAL' stands for Hypertext Application Language, a standard which structures API responses to contain not just data, but also hyperlinks for accessing related data. Using it helps to decouple client from server, easing the evolution of the RESTful API.
  18. Para Sounds like SOAP but worse tbh.
  19. deebo HATEOAS psychosis
  20. Para Well, at least "hate" is built in...
  21. deebo i just want to stop writing controller -> service -> repository crud, but spring-data-rest wants to produce something that's meant for 2005 i guess
  22. deebo don't think i've ever seen a "real" rest/hateoas/whatever api in the wild
  23. * MikeBux joined #java
  24. NeXeN deebo: consume the standard rest/hal api. shouldn't be writing custom json parsers. CollectionModel<T> would map directly to a collection response wrapped in _embedded, EntityModel<T> map to a single resource wrapped in hypermida links, then of course PageModel<T> maps pagged metadata like page, size, totalElements.
  25. NeXeN you know instead of using basic http client or standard jackson mapping, WebClient or RestTemplate or traverson
  26. NeXeN https://docs.spring.io/spring-hateoas/docs/current/reference/html/#client
  27. javabot NeXeN's title: "Spring HATEOAS - Reference Documentation"
  28. * vobar0 joined #java
  29. NeXeN i just feel like custom json parsers are an anti-pattern, *shrug*
  30. NeXeN if you just want standard crud, spring mvc controllers are better imho
  31. * X-Scale joined #java
  32. deebo .. its not custom anything? i'm just disabling the HAL/HATEOAS style response generation, so the responses area always plain application/json
  33. deebo but it's anyhow looking like i need to ditch this, seems it's forcing GET usage for search apis, which means you hit the url size limit with very few params in our case
  34. Para deebo: fwiw use idea's live templates :D
  35. Para Write your get controller handle as parameterized live template, allow the intelligent autocomplete to produce gaps, fill the gaps, repeat for service/repo, write the actual bits which are missing.
  36. * pebble joined #java
  37. * Inline joined #java
  38. * kathadris joined #java
  39. * Shell joined #java
  40. * GreenResponse joined #java
  41. deebo yeah already quickly wrote data-rest out, just have to find a generic way since all these repositories are just save + findById(s) + find(Pageable)
  42. * dostoyevsky2 joined #java
  43. * hwpplayer1 joined #java
  44. * Ragnor joined #java
  45. * Munnu joined #java
  46. * Nitrousoxide joined #java
  47. * five618480339176 joined #java
  48. * johnjay joined #java
  49. * kcomhnall joined #java
  50. * kcomhnall joined #java
  51. * stfstfm joined #java
  52. * stfstfm_ joined #java
  53. * stfstfm joined #java
  54. * domicron4 joined #java
  55. * jonp` joined #java
  56. * stfstfm_ joined #java
  57. * stfstfm joined #java
  58. * jonp` joined #java
  59. * stfstfm_ joined #java
  60. * stfstfm joined #java
  61. * Betal joined #java
  62. * stfstfm_ joined #java
  63. * stfstfm joined #java
  64. * jonp joined #java
  65. * stfstfm_ joined #java
  66. * stfstfm__4082 joined #java
  67. * domicron joined #java
  68. * P1RATEZ joined #java
  69. * ferdna joined #java
  70. * Aedil3 joined #java
  71. * rvalue joined #java
  72. * X-Scale joined #java
  73. * Joel joined #java
  74. * mwnaylor joined #java
  75. * rvalue joined #java
  76. * mindCrime joined #java
  77. * GreenResponse joined #java
  78. * X-Scale joined #java
  79. * Skynx joined #java
  80. * johnjay joined #java
  81. * jreicher joined #java
  82. * jjakob joined #java
  83. * rvalue joined #java