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

Invalid type bound from @ConfigurationProperties #2958

Closed
l0co opened this issue Mar 21, 2020 · 0 comments
Closed

Invalid type bound from @ConfigurationProperties #2958

l0co opened this issue Mar 21, 2020 · 0 comments
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@l0co
Copy link
Contributor

l0co commented Mar 21, 2020

In 2.0.0.M1.

I had the following configuration in yml:

my:
  security:
    intercept-url-map:
      graphql:
        -
          pattern: /api/public/graphql
          access:
            - isAnonymous()
        -
          pattern: /api/public/graphiql
          access:
            - isAnonymous()

Which was intepreted by this bean:

@ConfigurationProperties("my.security")
public class SecurityMapConfig {

	protected Map<String, List<BindableInterceptUrlMapPattern>> interceptUrlMap = new LinkedHashMap<>();

	public Map<String, List<BindableInterceptUrlMapPattern>> getInterceptUrlMap() {
		return interceptUrlMap;
	}

	public void setInterceptUrlMap(Map<String, List<BindableInterceptUrlMapPattern>> interceptUrlMap) {
		this.interceptUrlMap = interceptUrlMap;
	}

	public static class BindableInterceptUrlMapPattern {
		private String pattern;
		private List<String> access = new ArrayList<>();
		private HttpMethod httpMethod = null;

		public String getPattern() {
			return pattern;
		}

		public void setPattern(String pattern) {
			this.pattern = pattern;
		}

		public List<String> getAccess() {
			return access;
		}

		public void setAccess(List<String> access) {
			this.access = access;
		}

		public HttpMethod getHttpMethod() {
			return httpMethod;
		}

		public void setHttpMethod(HttpMethod httpMethod) {
			this.httpMethod = httpMethod;
		}

		public InterceptUrlMapPattern toInterceptUrlMapPattern() {
			return new InterceptUrlMapPattern(pattern, access, httpMethod);
		}
	}

}

This worked well in 1.3 but now in 2.0.0.M1 the value passed in List is not BindableInterceptUrlMapPattern but LinkedHashMap:

image

@graemerocher graemerocher added the type: bug Something isn't working label Mar 23, 2020
@graemerocher graemerocher added this to the 2.0.0.M2 milestone Mar 23, 2020
@graemerocher graemerocher self-assigned this Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants