You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When play crawles the resources from the server(no d2) it receives a map of them and get always the head. In case of sub-resources there can be lot's of them in the map and there is no guarantee that the first one is the root resource. To solve it i changed the code this way:
from -> optionsResponse.getResourceSchemas.values().asScala.head,
to -> optionsResponse.getResourceSchemas.values().asScala.filter(schema => getRootResource(schema,url)).head
and defined a function to filter:
def getRootResource(resourceSchema:ResourceSchema,url:String):Boolean ={
val resourceName = url.substring(url.lastIndexOf("/"))
resourceSchema.getPath.endsWith(resourceName)
}
this is a quick hack that allows me to continue my work but i am sure there is a better solution to it.
The text was updated successfully, but these errors were encountered:
When play crawles the resources from the server(no d2) it receives a map of them and get always the head. In case of sub-resources there can be lot's of them in the map and there is no guarantee that the first one is the root resource. To solve it i changed the code this way:
from -> optionsResponse.getResourceSchemas.values().asScala.head,
to -> optionsResponse.getResourceSchemas.values().asScala.filter(schema => getRootResource(schema,url)).head
and defined a function to filter:
def getRootResource(resourceSchema:ResourceSchema,url:String):Boolean ={
val resourceName = url.substring(url.lastIndexOf("/"))
resourceSchema.getPath.endsWith(resourceName)
}
this is a quick hack that allows me to continue my work but i am sure there is a better solution to it.
The text was updated successfully, but these errors were encountered: