我正在使用教程,一切都工作正常,直到我开始处理 swagger 2 依赖项。\n我现在想知道是否有办法解决这个问题。
\nSwagger配置:
\npackage com.animes.apirest.config;\n\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.service.Contact;\nimport springfox.documentation.service.VendorExtension;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\n\n\nimport static springfox.documentation.builders.PathSelectors.regex;\n\nimport java.util.ArrayList;\n\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n \n @Bean\n public Docket atividadeApi() {\n return new Docket(DocumentationType.SWAGGER_2)\n .select()\n .apis(RequestHandlerSelectors.basePackage("com.atividades.apirest"))\n .paths(regex("/api.*"))\n .build()\n .apiInfo(metaInfo());\n }\n\n private ApiInfo metaInfo() {\n\n ApiInfo apiInfo = new ApiInfo(\n "Atividades API REST",\n "API REST de cadastro de atividades.",\n "1.0",\n "Terms of Service",\n new Contact("Jo\xc3\xa3o VR", "www.una.br/",\n " "),\n "Apache License Version 2.0",\n "https://www.apache.org/licesen.html", new ArrayList<VendorExtension>()\n );\n\n return apiInfo;\n }\n}\n\nRun Code Online (Sandbox Code Playgroud)\npom.xml: …