Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue getting subresources #2

Open
albertolobrano opened this issue Jun 21, 2014 · 1 comment
Open

issue getting subresources #2

albertolobrano opened this issue Jun 21, 2014 · 1 comment
Assignees
Labels

Comments

@albertolobrano
Copy link

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.

@karanparikh karanparikh added bug and removed bug labels Jun 21, 2014
@karanparikh karanparikh self-assigned this Jun 21, 2014
@karanparikh
Copy link
Contributor

Hi @albertolobrano

I will take a look at this issue this weekend. Thanks for bringing this to our attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants