Skip to content

Commit

Permalink
fix: add more native type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
gschlueter-jaconi committed Jul 18, 2022
1 parent a461c1d commit 323e19c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
21 changes: 20 additions & 1 deletion src/main/java/io/jaconi/morp/MorpApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,31 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.cloud.gateway.handler.predicate.PathRoutePredicateFactory;
import org.springframework.cloud.gateway.handler.predicate.PredicateDefinition;
import org.springframework.cloud.gateway.route.CachingRouteLocator;
import org.springframework.cloud.gateway.route.RouteRefreshListener;
import org.springframework.cloud.gateway.support.ConfigurationService;
import org.springframework.nativex.hint.NativeHint;
import org.springframework.nativex.hint.TypeAccess;
import org.springframework.nativex.hint.TypeHint;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean;

import java.util.Collections;

@SpringBootApplication
@TypeHint(types = OptionalValidatorFactoryBean.class)
@ConfigurationPropertiesScan
@NativeHint(types = {
@TypeHint(types = OptionalValidatorFactoryBean.class),
@TypeHint(types = PredicateDefinition.class, access = TypeAccess.PUBLIC_CONSTRUCTORS),
@TypeHint(types = PathRoutePredicateFactory.Config.class, access = TypeAccess.PUBLIC_CONSTRUCTORS),
@TypeHint(types = ConfigurationService.class, access = TypeAccess.PUBLIC_CONSTRUCTORS),
@TypeHint(types = RouteRefreshListener.class, access = TypeAccess.PUBLIC_CONSTRUCTORS),
@TypeHint(types = CachingRouteLocator.class, access = TypeAccess.PUBLIC_CONSTRUCTORS),
@TypeHint(types = Collections.class, typeNames = "java.util.Collections$UnmodifiableMap", access = TypeAccess.PUBLIC_METHODS),
@TypeHint(types = SimpleGrantedAuthority.class, access = TypeAccess.PUBLIC_METHODS)
})
public class MorpApplication {
public static void main(String[] args) {
SpringApplication.run(MorpApplication.class, args);
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ <h1>OAuth 2.0 Login with Spring Security</h1>
<div>
<span style="font-weight:bold">User Attributes:</span>
<ul>
<li th:each="userAttribute : ${userAttributes}">
<span style="font-weight:bold" th:text="${userAttribute.key}"></span>: <span th:text="${userAttribute.value}"></span>
<li th:each="key : ${userAttributes.keySet()}">
<span style="font-weight:bold" th:text="${key}"></span>: <span th:text="${userAttributes.get(key)}"></span>
</li>
</ul>
</div>
Expand Down

0 comments on commit 323e19c

Please sign in to comment.