swagger

Swagger2异常 java.lang.NumberFormatException: For input string: ““

被刻印的时光 ゝ 提交于 2021-01-26 08:18:37
Swagger2异常 java.lang.NumberFormatException: For input string: "" 参考文章: (1)Swagger2异常 java.lang.NumberFormatException: For input string: "" (2)https://www.cnblogs.com/weianlai/p/11352143.html 备忘一下。 来源: oschina 链接: https://my.oschina.net/u/4356296/blog/4924732

Why discriminator property gets serialized twice?

心已入冬 提交于 2021-01-23 06:14:11
问题 I'm using OpenAPI 3.0 inheritance in components schemas and I have the (Java) classes generated by openapi-generator (which uses Jackson). Why the discriminator property gets serialized twice in the resulting JSON? This is a JHipster API-First project, which should use openapi-generator for generating the Java model (POJOs with Jackson annotations) and API controllers (interfaces with Spring's @Api annotations). By following the OpenAPI 3.x documentation/examples, it seems that the property

SpringBoot 集成Swagger

大憨熊 提交于 2021-01-23 05:49:31
Swagger简介: Design is the foundation of your API development. Swagger makes API design a breeze, with easy-to-use tools for developers, architects, and product owners. 大致意思是:以Swagger为基础来设计你API,使它变得更简介明了和易于维护; 使用: 1.引入依赖: <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.9.2</version> </dependency> 2.配置: (1)新建配置类,注意与项目的启动类放在同一块: (2)配置swagger的基本信息: import org.springframework.context.annotation.Bean; import org

Swagger天天用,背后原理来一次深度解析

点点圈 提交于 2021-01-22 17:40:01
先说一说Springfox和Swagger的关系 Swagger 是一种规范。 springfox-swagger 是基于 Spring 生态系统的该规范的实现。 springfox-swagger-ui 是对 swagger-ui 的封装,使得其可以使用 Spring 的服务。 由于工作中遇到需要基于 Swagger Json 做一些处理,但 Swagger Json 的格式不是那么满足需求。 本文springfox-swagger版本号:2.6.0 本文从问题出发,探索涉及的源码。 GET 方法的参数对象 第一个问题,当方法是GET请求,但参数是一个自定义 Object,在展示时(生成的JSON)是不包括本 Object 描述的。所以,就要看看什么时候会生成这些 Model 的描述。 万事有始有终,SpringFox始就在:springfox.documentation.spring.web.plugins下的 DocumentationPluginsBootstrapper。 该类实现了 SmartLifecycle 接口,实现此接口且通过@Component注入到容器的bean, 容器初始化后会执行start()方法. @Component public class DocumentationPluginsBootstrapper implements

SpringBoot结合MyBatis Plus 自动生成代码

偶尔善良 提交于 2021-01-17 08:39:04
SpringBoot结合MyBatis Plus 自动生成代码 本来这一章要介绍Redis+AOP优化权限,可是发现还是需要先介绍一些MyBatis Plus自动生成代码 MyBatis Plus简介 MyBatis-Plus (opens new window)(简称 MP)是一个 MyBatis (opens new window)的增强工具,在 MyBatis 的基础上只做增强不做改变,为简化开发、提高效率而生。 MyBatis Plus特性 无侵入:只做增强不做改变,引入它不会对现有工程产生影响,如丝般顺滑 损耗小:启动即会自动注入基本 CURD,性能基本无损耗,直接面向对象操作 强大的 CRUD 操作:内置通用 Mapper、通用 Service,仅仅通过少量配置即可实现单表大部分 CRUD 操作,更有强大的条件构造器,满足各类使用需求 支持 Lambda 形式调用:通过 Lambda 表达式,方便的编写各类查询条件,无需再担心字段写错 支持主键自动生成:支持多达 4 种主键策略(内含分布式唯一 ID 生成器 - Sequence),可自由配置,完美解决主键问题 支持 ActiveRecord 模式:支持 ActiveRecord 形式调用,实体类只需继承 Model 类即可进行强大的 CRUD 操作 支持自定义全局通用操作:支持全局通用方法注入( Write once,

Devops下的接口全生命周期质量建设

南笙酒味 提交于 2021-01-16 09:24:26
什么是devops?随着时间的推移,devops的定义也在不断的演进。对于其定义可能出现千人千面,但从核心观点,整体业界还是保持着一致的认识。DevOps不是单一的技术或者工具,甚至不只是一个流程,他包含应用设计、敏捷开发、持续交付和监控运维等一系列流程,涉及到企业文化、团队协作流程等多个方面,它可以被理解为一系列可以高速、高质量进行软件开发的工具链。 结合软件生产全生命周期来看,devops落地实践的 核心目标是缩短开发周期,提高部署频率和更可靠的发布。 DevOps的诞生源于企业要适应这个瞬息万变的市场,能够做到持续交付。正如《持续交付2.0》作者在书中精炼的2个环:价值探索和快速验证。 快速验证环的 两个核心关键是质量与速度 它会要求以最可靠的质量和最快的速度,交付最小可行方案,可靠地收集真实反馈,来形成这样的闭环。对于质量来讲一个核心的实践就是质量内建,有一个公认的事实。那就是在整个持续交付全生命周期过程中,缺陷越滞后发现,所需要的成本就越高。质量内建就是要从生产过程中的第一个环节开始,就要注重产出物的质量,并且在每个环节中都要去开展质量保障活动,这就要求在软件全生命周期参与的各个角色都需要实时的对软件的质量负责。确保软件在交付到下一个环节前有了基础的质量保障。其核心目的就是减少因为质量问题导致的返工,避免浪费大量人力成本。 速度

Is it any ability to upload MultipartFile with Model in Swagger? (In comment 415 Unsupported Media Type Resolved)

不想你离开。 提交于 2021-01-16 03:58:29
问题 I'm using the last (and only) <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> <version>3.0.0</version> </dependency> with spring boot <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.4.1</version> <relativePath/> <!-- lookup parent from repository --> </parent> I would like to have ability to upload file and model in one controller, so I created one: in this case on swagger-ui I see

Is it any ability to upload MultipartFile with Model in Swagger? (In comment 415 Unsupported Media Type Resolved)

百般思念 提交于 2021-01-16 03:54:53
问题 I'm using the last (and only) <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> <version>3.0.0</version> </dependency> with spring boot <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.4.1</version> <relativePath/> <!-- lookup parent from repository --> </parent> I would like to have ability to upload file and model in one controller, so I created one: in this case on swagger-ui I see

Is it any ability to upload MultipartFile with Model in Swagger? (In comment 415 Unsupported Media Type Resolved)

人盡茶涼 提交于 2021-01-16 03:52:42
问题 I'm using the last (and only) <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> <version>3.0.0</version> </dependency> with spring boot <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.4.1</version> <relativePath/> <!-- lookup parent from repository --> </parent> I would like to have ability to upload file and model in one controller, so I created one: in this case on swagger-ui I see

Golang 根据Gorm和Gin开发一个后台管理系统

回眸只為那壹抹淺笑 提交于 2021-01-13 08:24:33
\\\\\\\\\\\ English | 简体中文 Project Guidelines Web UI Framework:element-ui Server Framework:gin Grom Framework: gorm 1. Basic Introduction 1.1 Project structure │ ├─conf (Config file) │ ├─docs (swagger APIs docs) │ ├─log (log file) │ ├─public (public static file) │ ├─static (head icon) ├─src │ ├─controller (Controller) │ ├─middleware (Middleware) │ ├─models (Model entity) │ ├─pkg (Project private package) │ ├─adapter (Casbin adapter) │ ├─app (Gin service response) │ ├─codes (Response code) │ ├─error (Project private error) │ ├─gredis (Redis) │ ├─query (Songo parase to SQL line) │ ├─setting