I was wondering, why swagger-ui is not able to open the customized yaml. It is a matter of authorization. That way I found out, that the application.properties setting “jmix.rest.anonymous-url-patterns = jmix.rest.anonymous-url-patterns = /rest/docs/*” does not seem to work anymore respectively does not exist anymore (can’t be resolved).
I am using Jmix version: 1.5.5 and Jmix Studio plugin version: 2.1.3-233.
the jmix.rest.anonymous-url-patterns does exist and is used in the io.jmix.rest.security.impl.RestAuthorizedUrlsProvider#getAnonymousUrlPatterns method.
Could you please describe your problem in more detail? A demo project that reproduces the issue is appreciated.
IDE suggests only properties defined in the Properties classes (the one with @ConfigurationProperties annotation), but application properties can be loaded by name in any place. As I mentioned earlier, jmix.rest.anonymous-url-patterns does exist and is used in the io.jmix.rest.security.impl.RestAuthorizedUrlsProvider#getAnonymousUrlPatterns method. Below it’s implementation:
@Component("rest_RestAuthorizedUrlsProvider")
public class RestAuthorizedUrlsProvider implements AuthorizedUrlsProvider {
....
@Override
public Collection<String> getAnonymousUrlPatterns() {
List<String> urlPatterns = jmixModules.getPropertyValues("jmix.rest.anonymous-url-patterns");
return urlPatterns.stream()
.flatMap(s -> urlPatternSplitter.splitToList(s).stream())
.collect(Collectors.toList());
}
}
Thank you Gleb! I admit that I am still confused and unfortunately have not the time to dive deep into it. The sample provided throws a lot of errors at first glance.
Is there any reason for having those application properties listed in the documentation and sample but actually not implemented? Don’t get me wrong but JMIX (I love it!!!) arguments with “low code” approaches. But very often it has to have a deep understanding of Java spring to understand samples.