草庐IT

$swagger

全部标签

Spring boot 实战指南(三):配置事务,整合Elasticsearch、swagger、redis、rabbitMQ

文章目录一、配置事务依赖使用注解二、Elasticsearch创建项目配置maven完善依赖es连接配置实体映射repositoryservicecontroller三、swagger依赖启动类路径匹配配置配置类controller注解四、redis(代码实现)依赖yml配置配置类封装redisTamplate五、rabbitMQ依赖yml配置配置类生产者代码消费者代码测试一下一、配置事务依赖!--事务管理依赖以下二选一即可-->!--用来开启事务使用但是mybatis-plus-boot-starter默认引入了sprint-tx-->!--dependency>-->!--groupId>

java - 如何在 Kotlin 中使用 Swagger @ApiResponses 注解?

如何将以下Swagger注解从Java转换为Kotlin?@ApiResponses(value={@ApiResponse(code=200,message="Givenadminuserfound"),@ApiResponse(code=404,message="..."),@ApiResponse(code=500,message="..."),@ApiResponse(code=400,message="..."),@ApiResponse(code=412,message="...")})这不起作用:@ApiResponses(value=listOf(ApiResponse

java - 如何在 Kotlin 中使用 Swagger @ApiResponses 注解?

如何将以下Swagger注解从Java转换为Kotlin?@ApiResponses(value={@ApiResponse(code=200,message="Givenadminuserfound"),@ApiResponse(code=404,message="..."),@ApiResponse(code=500,message="..."),@ApiResponse(code=400,message="..."),@ApiResponse(code=412,message="...")})这不起作用:@ApiResponses(value=listOf(ApiResponse

Swift 4 支持 swagger 代码生成

我在从YAML文件生成swift模型时遇到了问题。swagger-codegengenerate-iswagger_1.yaml-lswift4下面是示例模型之一。这不是在swift4中构建的。因为没有编码键importFoundationopenclassUser:Codable{publicenumSex:String,Codable{casemale="male"casefemale="female"}publicvarid:Int64?publicvarusername:String?publicvarfirstName:String?publicvarlastName:Str

ios - 从生成的 swagger 代码中使用 swift 客户端发布图像

我想使用生成的swift-client发布图像。经过大量研究,我认为最好的指定方式是:/user/profilepicture:put:description:|uploadprofilepictureofuserconsumes:-multipart/form-dataparameters:-name:profilePhotoin:formDatatype:file生成的swift客户端函数签名为:publicclassfuncusersProfilepicturePut(profilePhotoprofilePhoto:NSURL?=nil,completion:((error:E

java - Swagger 不够智能,无法处理匿名类型(例如 map )

我正在使用enunciate生成SwaggerRESTAPI的文档。我的一个遗留bean包含一个Map,而Swagger对此提示:[INFO]---maven-enunciate-plugin:1.27:docs(default)@foo-api---[INFO]initializingenunciate.[INFO]invokingenunciate:generatestep...[WARNING]Validationresulthaserrors./.../rest/BarBean.java:170:[swagger]Swaggerisn'tsmartenoughtohandlea

java - 使用外部枚举定义从 JAX-RS 端点生成 Swagger

我想从具有外部枚举定义的JAX-RS端点生成swagger,但是生成的swagger直接将枚举包含到模型的定义中。这意味着没有生成枚举文档,而且在客户端复制了相同的枚举。我使用swagger-jaxrs依赖项来扫描我的端点并生成swaggerjson文件。这个GitHubrepository可用于重现问题。我还创建了一个GitHubissue在swagger-core存储库上。JAX-RS端点@Api("hello")@Path("/helloSwagger")publicclassHelloSwagger{@ApiOperation(value="Getalluniquecustom

java - Swagger Codegen CLI Java 客户端 - 如何正确使用它

我目前正在使用我的jersey2休息服务。为了更好地了解给定服务(描述、类型等),我大量使用了swagger(swagger-jersey2-jaxrs)。因此,我能够生成我的服务描述(swagger.json),并且我可以通过swaggerui查看和探索它们。现在我需要创建一些客户端来使用这些服务。我遇到了swaggercodegencli,这是一个很好的工具来生成你的客户端和许多不同的语言(在我的例子中是java)。我能够生成api客户端和正在使用的模型。这里我遇到了第一个问题。REST服务和swagger描述受http基本身份验证保护。我读了documentation这给了我一些

java - 在 Swagger 中记录 Spring 的登录/注销 API

我正在使用SpringBoot开发演示REST服务,用户必须登录才能执行某些操作子集。使用简单配置添加SwaggerUI(使用springfox库)后:@BeanpublicDocketdocApi(){returnnewDocket(DocumentationType.SWAGGER_2).select().apis(any()).paths(PathSelectors.ant("/api/**")).build().pathMapping("/").apiInfo(apiInfo()).directModelSubstitute(LocalDate.class,String.cla

java - 如何生成离线 Swagger API 文档?

我有一个springbootMVCjavaWeb应用程序。我已经能够为API文档集成Springfox。当服务器启动并运行时,我可以直观地看到所有API。如何生成离线swaggerAPI文档?注意:我不想使用asciidoc或markdown文档,但我希望在html文件中使用相同的swaggerAPI用户界面。我希望链接是相对于本地目录而不是本地主机服务器链接。谢谢 最佳答案 Springfox允许您根据Spring注释轻松创建Swagger测试器/API文档。Swagger本身有一些工具可以让你生成离线/静态文档:SwaggerE