Hi,

we use Swagger with Spring Cloud and Spring Rest to provide simple means to 
read and create data during our development phase. We have problem reading 
data when the object which is retrieved has nested object in more than 2 
layers of deepness (forgive me my wording, not a native speaker).

Example: Vehicle.parking -> Parking, Parking.homebase -> Homebase

We do NOT provide any Swagger files, we just let Swagger read the endpoints 
and model during startup of our Spring Boot services.

When we call a simple Swagger call like findAll, we get the following error 
message:

2018-01-03 12:40:53.489  WARN 9096 --- [http-nio-6790-exec-5] 
.w.s.m.s.DefaultHandlerExceptionResolver : Failed to write HTTP message: 
org.springframework.http.converter.HttpMessageNotWritableException: Could 
not write JSON: Invalid property 'homebase' of bean class 
[com.creative_it.seamless.vehicleadministrationservice.model.Vehicle]: 
Could not find field for property during fallback access!; nested exception 
is com.fasterxml.jackson.databind.JsonMappingException: Invalid property 
'homebase' of bean class 
[com.creative_it.seamless.vehicleadministrationservice.model.Vehicle]: 
Could not find field for property during fallback access! (through 
reference chain: 
org.springframework.hateoas.PagedResources["_embedded"]->java.util.Collections$UnmodifiableMap["vehicles"]->java.util.ArrayList[0]->org.springframework.data.rest.webmvc.json.PersistentEntityJackson2Module$ProjectionResource["content"]->com.sun.proxy.$Proxy239["homebase"])


We are very much stuck as we don't understand why Swagger thinks the 
"homebase" property should be on Vehicle (or maybe the error message is 
just misleading).


Any help very much appreciated!


BR,

Günther

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to