OpenAPI Swagger для весенней загрузки 2.2.2 - PullRequest
0 голосов
/ 10 января 2020

Я пытаюсь интегрировать openapi в весеннюю загрузочную версию 2.2.2.

<dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-ui</artifactId>
        <version>${springdoc-openapi-version}</version>
    </dependency>
    <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-webmvc-core</artifactId>
        <version>${springdoc-openapi-version}</version>
    </dependency>
    <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-security</artifactId>
        <version>last.version</version>
    </dependency>

Я перешел по этой ссылке, чтобы настроить. https://www.dariawan.com/tutorials/spring/documenting-spring-boot-rest-api-springdoc-openapi-3/

Но при попытке получить доступ к ссылке http://localhost: 9000 / swagger-ui. html

Я не могу загрузить пользовательский интерфейс. я получаю ошибки, как показано enter image description here

Я использую приведенное ниже разрешение, чтобы разрешить URL-адрес swagger в ResourceServerConfigurerAdapter

@Override
public void configure(HttpSecurity http) throws Exception {
http.cors().and().authorizeRequests()

    .antMatchers(HttpMethod.GET, "/actuator/health").permitAll()
    .antMatchers(HttpMethod.GET, "/v3/api-docs").permitAll() // for swagger docs
    .antMatchers("/swagger-ui.html", "/swagger-ui/index.html", "/v3/api-docs/swagger-config",
        "/swagger-ui/**")
    .permitAll().antMatchers(HttpMethod.GET, "/v3/api-docs.yaml").permitAll()
    .antMatchers(HttpMethod.GET, "/swagger.yaml").permitAll().anyRequest().authenticated();
   }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...