Bom dia,
Estou usando a versão do spring conforme abaixo:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
E a seguinte dependência:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.0.2</version>
</dependency>
Porém no trecho da classe SecurityConfigurations
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception{
return http.csrf().disable()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and().authorizeRequests()
.antMatchers(HttpMethod.POST,"/login").permitAll()
.requestMatchers("/v3/api-docs/**", "/swagger-ui.html", "/swagger-ui/**").permitAll()
.anyRequest().authenticated()
.and().addFilterBefore(securityFilter, UsernamePasswordAuthenticationFilter.class)
.build();
}
Está ocorrendo erro justamente na classe ao carregar a aplicação Erro de execução:
C:\sts-workspace\alura-cursos-formações\springboot-api-rest\src\main\java\med\voll\api\infra\security\SecurityConfigurations.java:29:17
java: method requestMatchers in class org.springframework.security.config.annotation.web.AbstractRequestMatcherRegistry<C> cannot be applied to given types;
required: org.springframework.security.web.util.matcher.RequestMatcher[]
found: java.lang.String,java.lang.String,java.lang.String
reason: varargs mismatch; java.lang.String cannot be converted to org.springframework.security.web.util.matcher.RequestMatcher
Por favor, poderia me auxiliar ser é erro de versão do springdoc-openapi