mohamedragab / puelia-php

Automatically exported from code.google.com/p/puelia-php
0 stars 0 forks source link

two config files with similar patterns (staging/live) rules matching incorrectly. #51

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Config file 1 /doc/resource/{identifier}
2. duplicate first config file and add /staging/doc/resource/{identifier}
3. try to get the staging URI 
4. try to get the live URI

What is the expected output? What do you see instead?
live URI like /id/... should conneg to /doc/...
staging uri like /staging/id/... should conneg to /staging/id/...

result live connegs to staging.

What version of the product are you using? On what operating system?
r205

Please provide any additional information below.

Original issue reported on code.google.com by hodson....@gmail.com on 22 Jul 2011 at 4:00

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Tim,

OK, correct me if I'm wrong.

staging doesn't have separate /staging/id/ URIs  only /staging/doc/ document 
URIs. The actual resource ID URIs are the same. 

eg:
stagingspec:resource
    a api:ItemEndpoint ;
    api:uriTemplate "/staging/doc/resource/{identifier}" ;
    api:itemTemplate "http://bnb.data.bl.uk/id/resource/{identifier}" ;
    api:exampleRequestPath "/staging/doc/resource/013763041" ;
    .
spec:resource
    a api:ItemEndpoint ;
    api:uriTemplate "/doc/resource/{identifier}" ;
    api:itemTemplate "http://bnb.data.bl.uk/id/resource/{identifier}" ;
    api:exampleRequestPath "/doc/resource/013763041" ;
    .

When you request a resource ID URI, puelia is matching it to the first matching 
ItemEndpoint it can find - which in your case happens to be a staging one. 

So from the info you've provided here, there doesn't seem to be any strange 
behaviour. Let me know if I'm misunderstanding something.

Original comment by K.J.W.Al...@gmail.com on 12 Aug 2011 at 3:07