如何解决swagger界面中的basic-error-controller

springboot2.6.3整合swagger3 消除Basic Error Controller,actuator 阅读详情

最有效解决方法

  1. 检查你的启动类(xxxAplication.java)
  2. 把@EnableSwagger2改成@EnableSwagger2Doc
  3. 访问路径:端口后面添加/doc.html。例如:http://localhost:8033/doc.html

全部看完,再感谢我,如果跟你的有区别那就继续百度…

pom.xml

		<!--Swagger-BootstrapUI-->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.9.2</version>
        </dependency>
        <dependency>
            <groupId>com.github.xiaoymin</groupId>
            <artifactId>swagger-bootstrap-ui</artifactId>
            <version>1.9.6</version>
        </dependency>
        <dependency>
            <groupId>com.spring4all</groupId>
            <artifactId>swagger-spring-boot-starter</artifactId>
            <version>1.9.0.RELEASE</version>
        </dependency>

yml

swagger:
  enabled: true
  title: 标题
  version: 版本
  description: 描述
  base-package: 基础路径(*重要*)
  #作者
  contact:
    name: Az
    email: azt0903@163.com

我用的是Swagger-BootstrapUI,springboot版本2.5.7。
效果图如下:
在这里插入图片描述

K8S集群安全加固:修复Kuboard管理界面Swagger未授权访问漏洞 在云原生架构中,API管理工具如Swagger UI常用于可视化与调试接口,但其默认配置常因访问控制缺失而暴露未授权访问风险,导致敏感API文档泄露。这种信息泄露漏洞虽不直接引发容器逃逸,却为攻击者提供了清晰的内部应用“地图”,可能导向更精准的注入攻击或业务逻辑推断,尤其在Kubernetes这类复杂环境中,会加剧横向移动与多租户隔离隐患。从工程实践看,修复需兼顾安全与运维便利,核心思路是实施零信任网络策略,通过Ingress路径精准拦截、NetworkPolicy网络层隔离或修改服务暴露方式,收敛攻击面。 阅读详情

相关推荐

SQL Prompt 9.0插件突然无法使用解决办法(附防联网激活)多图+文字

可能由于Redgate公司最近抓盗版抓得严,导致激活后的SQL Prompt联网后突然无法使用,无论卸载重装都没办法继续使用,本人同时使用SQL Assistant和SQL Prompt,我喜欢SQL Assistant代码提示功能,而SQL Prompt我喜欢将查询结果复制后可以直接生产插入脚本,这是最爽的一件事,即便对表有多么熟悉,没有这些插件,几行语法都要敲大半天,目前本人已经离不开这两个插...

骚团长的博客 1万+

Swagger2 总结

Swagger 2 相关基本配置总结

.G();的博客 6169

利用ArcGIS的模型构建器实现批量投影栅格和批量克里金插值

博主要批量投影几百个栅格,但是ArcGIS中的投影栅格的批处理工具需要手动一条条设置参数,还是麻烦,因此学习了使用模型构建器(ModelBuilder)来批量投影栅格,可以导入需投影栅格的文件夹,然后迭代投影,并按栅格原名逐个输出到指定目录。 1.在工具箱里构建模型 在arctool box里右键点击空白处,选择【添加工具箱】,点击ArcGIS默认工作目录的工具箱进行添加,然后Toolbox就会被添加到ArcToolbox页面,右键点击Toolbox,选择“新建”-“模型” 2.编写模型 (1).

qq_36958801的博客 1万+

解决访问swaggerUI接口文档显示basic-error-controler问题

解决访问swaggerUI接口文档显示basic-error-controler问题 原文地址:https://www.cnblogs.com/longronglang/p/9045559.html 问题描述 使用swagger生成接口文档后,访问http://localhost:8888/swagger-ui.html#/,显示如下: 去除basic-error-controller方法: 注意《不显示错误的接口地址》的配置 import com.google.common.base.Predicate

whiteofwang的博客 4757

招财牛猫|股社区|猫笔刀公众号历史文章13-21年(含评论),投资内容 收藏学习

招财大牛猫|股社区|猫笔刀公主号历史文章13-21年(含评论)

ZhaoCaiDaNiuMao的博客 7239

超临界二氧化碳发电技术深度解析

超临界二氧化碳发电技术正在突破传统热电转换的物理边界。作为新一代发

硬核科技 602

Swagger一直显示basic-error-controller

表示swagger会把加了@ ApiOperation的方法扫描进去。

qq_39452315的博客 3006

自监督学习原理与代码实战案例讲解

自监督学习原理与代码实战案例讲解 作者:禅与计算机程序设计艺术 1. 背景介绍 1.1 自监督学习的起源与发展 1.1.1 监督学习的局限性

AI天才研究院 624

有关swagger的 basic-error-controller Basic Error Controller

basic-error-controller Basic Error Controller 这没什么影响但是就是看着不开森 导入的依赖 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.8.0</v

qq_41280118的博客 8283

什么是 AIDV(AI 定义汽车):从软件定义到智能决策的范式革命

AI定义汽车(AIDV),是指以人工智能(尤其是大模型、深度学习、强化学习)为核心引擎,以车载AI芯片为算力底座,以“数据闭环”为迭代支撑,重构汽车感知、决策、执行全链路,实现“感知智能化、决策自主化、体验个性化、迭代自动化”的新一代智能汽车发展范式。其核心是让汽车从“执行工具”升级为“具备自主学习与智能决策能力的移动智能终端”,核心价值是“车与人的深度协同”与“复杂场景的自主适配”。

getusushu的博客 97

全面指南:PyTorch与ROCm版本兼容性及多版本环境管理

本文详细介绍了在AMD GPU上配置PyTorch开发环境的完整流程,重点解决版本兼容性和多版本ROCm环境管理问题。主要内容包括:1) PyTorch与ROCm版本对应关系查询;2) 四种查看ROCm版本的方法;3) 使用update-alternatives管理多版本ROCm;4) 环境变量配置与冲突解决方案;5) 完整的验证流程和性能测试方法。文章提供了最佳实践建议和故障排除清单,帮助开发者快速搭建稳定高效的深度学习开发环境,充分发挥AMD GPU硬件性能。通过系统化的验证流程确保各组件协同工作,解决

数字人生 607

Springboot使用Swagger显示basic error controller问题

Springboot使用Swagger显示basic error controller问题 添加Swagger配置类 import org.assertj.core.internal.Predicates; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet

sll714827的博客 3843

气象水文资料预处理:缺测数据插补延长等

简介气象水文资料预处理

WW、forever的博客 3772

springboot 使用swagger 不显示basic-error-controller解决

在启动类的主类下加入如下代码, `/* 配置 swagger开始 / @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).pathMapping(“/”).select() // 选择那些路径和api会生成documen...

攻防人生3722的博客 1万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

SpringBoot Swagger去掉basic-error-controller

添加一个bean: @Bean public Docket demoApi() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.any()) .paths(PathSelectors.regex("(?!/error.*).*")) .build() } ...

这就是快乐嘛 4888

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

springboot整合swagger3 消除Basic Error Controller,actuator

springboot整合swagger3 消除Basic Error Controller,actuator

州仔 841

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

Swagger3 去掉basic-error-controller

原swagger2的写法 swagger3的写法

m0_37123059的博客 3137

springboot+mybatis-plus 配置swagger。以及出现Basic Error Controller后的解决方式

pom文件中添加配置: <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.7.0</version> </dependency> <dependency

sinat_33890906的博客 571

springboot 不使用 thymeleaf_springboot 使用swagger 不显示basic-error-controller解决

问题描述使用swagger生成接口文档后,访问http://localhost:8888/swagger-ui.html#/,显示如下:有些强迫症的我,感觉看起来很不舒服,结果百度了好久,找到解决方案,刚接触spring boot对于很多api还不是很熟悉,先mark再说代码如下:package com.course.config;import com.google.common.base.Pre...

weixin_40008033的博客 513

访问swaggerUI接口文档显示basic-error-controller问题

package com.shanjupay.merchant.config; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.docume.

LeslieTsai2019的博客 975

SpringBoot中Swagger的构建和遇见坑

一、构建swagger UI文档 1、加入依赖 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.0.RELEASE&...

Haihao_micro的博客 340

Swagger3.0.0(SpringFox)使用遇到的问题

Swagger3.0.0(SpringFox)部署报错

阿鑫的博客 1223

[swagger]springboot结合swagger

file-》new-》project-》spring initializr -》直接下一步选择java8-》选择web ,spring web 我pom中引用的是2.4.0版本 3.添加swagger配置 配置完就可以尝试启动程序了,访问localhost:8080出现如下界面 再次执行就有如下界面 application.yml文件可以修改端口号和访问时候的路径,默认端口是8080...

MyNameIsWangYi的博客 579
上一篇: Idea中从mapper到mapper.xml相互跳转的没有花里胡哨功能的插件
下一篇: springboot项目启动报错Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedde
Az&who you are
博客等级 码龄8年 17粉丝 14原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值