检测到无效的映射模式:/**/swagger-ui/** [英] Invalid mapping pattern detected: /**/swagger-ui/**

查看:205
本文介绍了检测到无效的映射模式:/**/swagger-ui/**的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将 springdoc-openapi-ui 用于 Spring Boot API 文档并面临以下问题 -

I am using springdoc-openapi-ui for spring boot API documentation and facing the following issue -

我已经添加了所有必要的配置如下 -

I have added all the necessary configuration as follows -

  1. maven 依赖 -

<dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-ui</artifactId>
            <version>1.5.2</version>
</dependency>

  1. 这是主文件 -

package com.abc.tl;
    
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@OpenAPIDefinition
public class TLApplication {

    public static void main(String[] args) {

        SpringApplication.run(TLApplication.class, args);

    }
}


使用java版本-11,不确定问题出在哪里,项目无法运行.

Using java version - 11, Not sure where is the Issue, the project is not able to run.

推荐答案

通过以下依赖,解决了这个问题.

With following dependencies, solved this issue.

 <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.6.0</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

<dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-ui</artifactId>
        <version>1.5.12</version>
</dependency>

这篇关于检测到无效的映射模式:/**/swagger-ui/**的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆