NCATS-Tangerine / translator-knowledge-beacon

NCATS Translator Knowledge Beacon Application Programming Interface plus Sample code
MIT License
7 stars 2 forks source link

Path variable truncation causes problems for CURIEs that use period characters #16

Open meera-gd opened 7 years ago

meera-gd commented 7 years ago

By default, Spring's @RequestMapping truncates everything after the last . in a @PathVariable. For example, "complex.filename.html" is passed in as "complex.filename". This is a problem for API calls of the form /path/{value}.

For example, for the request /exactmatches/HGNC.SYMBOL%3ADMBT1, Spring passes "HGNC" in into the conceptId variable, as if you had requested /exactmatches/HGNC.

This issue affects the beacon aggregator as well as the translator knowledge beacon. I haven't checked the reference beacon.

meera-gd commented 7 years ago

In Java, this can be solved by adding the following config class into the server project.

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class SpringConfiguration extends WebMvcConfigurerAdapter {

    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        configurer.setUseSuffixPatternMatch(false);
    }

}
cmungall commented 6 years ago

We need better docs on what curie prefixes are accepted.

The dot style separator is popular in identifiers dot or, but I think we can do without the dot style IDs. For example, we shouldn't treat HGNC symbols as identifiers. We should just have HGNC:nnnn for the IDs themselves

cc @jmcmurry @putmantime