deeboanyone happen to use spring-data-rest? is there some existing class in some spring library for deserializing json from the "weird" { "_embedded": { "resultTypes": [...] } response?
deebo-> config.useHalAsDefaultJsonMediaType(false) -> everyone started clapping
Para~gpt summarize what jackson's config.useHalAsDefaultJsonMediaType means and what does it do in context of spring-data-rest, including what is "hal"
javabotIn 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.
ParaSounds like SOAP but worse tbh.
deeboHATEOAS psychosis
ParaWell, at least "hate" is built in...
deeboi just want to stop writing controller -> service -> repository crud, but spring-data-rest wants to produce something that's meant for 2005 i guess
deebodon't think i've ever seen a "real" rest/hateoas/whatever api in the wild
* MikeBux joined #java
NeXeNdeebo: 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.
NeXeNyou know instead of using basic http client or standard jackson mapping, WebClient or RestTemplate or traverson
NeXeNi just feel like custom json parsers are an anti-pattern, *shrug*
NeXeNif you just want standard crud, spring mvc controllers are better imho
* X-Scale joined #java
deebo.. its not custom anything? i'm just disabling the HAL/HATEOAS style response generation, so the responses area always plain application/json
deebobut 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
Paradeebo: fwiw use idea's live templates :D
ParaWrite 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.
* pebble joined #java
* Inline joined #java
* kathadris joined #java
* Shell joined #java
* GreenResponse joined #java
deeboyeah already quickly wrote data-rest out, just have to find a generic way since all these repositories are just save + findById(s) + find(Pageable)