swagger

“discriminator” in polymorphism, OpenAPI 2.0 (Swagger 2.0)

杀马特。学长 韩版系。学妹 提交于 2019-12-17 19:57:17
问题 Referencing OpenAPI 2.0, Schema Object, or Swagger 2.0, Schema Object, and the definition of discriminator field as: Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. My confusions/ questions: It is ambiguous

cleanest way to glue generated Flask app code (Swagger-Codegen) to backend implementation

落花浮王杯 提交于 2019-12-17 18:49:43
问题 I have: a library that does [Stuff] a swagger API definition, which is roughly #1 with minor differences to map cleanly to a REST service a flask app generated #2 using Swagger-Codegen - eg results in python controller functions roughly one-to-one with #1. My intent is that the flask app (all generated code) should only handle mapping that actual REST api and parameter parsing to match the API spec coded in swagger. After any parameter parsing (again, generated code) it should call directly

Validating JSON against Swagger API schema

家住魔仙堡 提交于 2019-12-17 18:14:51
问题 I created an API spec from some JSON files and I am trying to test if the files validate against the API spec. There are some good tools to validate against JSON Schema, but I did not have chance to find a tool to validate against specs created in the Swagger (tool for creating API schema). The only solution I found is generating a client/server in the Swagger-Editor, it is quite cumbersome. Is there already an existing tool to validate JSON against Swagger Schema? 回答1: Arnaud in the comments

How to write OpenAPI 3 (Swagger) specification for property name in `map` object?

时光总嘲笑我的痴心妄想 提交于 2019-12-17 09:58:30
问题 The API I'm trying to describe has a structure where the root object can contain an arbitrary number of child objects (properties that are themselves objects). The "key", or property in the root object, is the unique identifier of the child object, and the value is the rest of the child object's data. { "child1": { ... bunch of stuff ... }, "child2": { ... bunch of stuff ... }, ... } This could similarly be modeled as an array, e.g.: [ { "id": "child1", ... bunch of stuff ... }, { "id":

自动化如何选择用例

假装没事ソ 提交于 2019-12-17 09:58:25
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在开始实施测试自动化时,应该选择那些用例优先进行自动化? 问题来源于群里的一次聊天,在测试自动化实施中如何最大产出的问题。强调自动化覆盖率?太片面了不太行。自动化效率?由于稳定性和可靠性不给力,这一条好像也不行。BUG比率?这项更不行。 但是第一步都是需要将测试用例自动化,那么如何选择要自动化的测试以及将哪些测试留给手动测试? 在开始自动化测试之前,需要考虑到在自动化测试上投入的时间、精力和资源后,看看自动化测试可以带来什么好处。以下是确定哪些手动测试应该或不应该自动化应该考虑的问题。俗话说,仅仅因为您可以使某些东西自动化并不一定意味着应该这样做。 下面是一些观点,给各位解决这个问题提供一些参考: 应该自动化的测试: 业务关键路径:如果功能或用户操作失败,则会对业务造成损害。 需要针对应用程序的每个内部版本/发行版运行的测试,例如冒烟测试,健全性测试和回归测试。 需要针对多种配置(不同的OS和浏览器组合)运行的测试。 执行相同工作流程的测试在每次测试运行中使用不同的数据作为输入,例如数据驱动。 涉及输入大量数据的测试,例如填写很长的表格。 可用于性能测试的测试,例如压力测试和负载测试。 测试需要很长时间才能执行,并且可能需要在休息时间或通宵进行。 测试必须捕获图像的过程,以证明应用程序的行为符合预期

Re-using model with different required properties

对着背影说爱祢 提交于 2019-12-17 09:53:29
问题 I have a path that uses complex models with almost identical properties for each http method. The problem is that I want to define some required properties for the request of PUT and POST, while no properties are required in GET response (as the server always returns all properties and it's mentioned elsewhere in the documentation). I created a simple cat API to demonstrate what I've tried. The idea is that for GET response the response model doesn't have anything marked as required, but the

SpringBoot与Swagger整合

廉价感情. 提交于 2019-12-16 16:01:15
1 SpringBoot与Swagger整合 https://blog.csdn.net/jamieblue1/article/details/99847744 2 Swagger详解(SpringBoot+Swagger集成) https://blog.csdn.net/ai_miracle/article/details/82709949 3 SpringBoot 使用Swagger2打造在线接口文档(附汉化教程) https://www.cnblogs.com/suizhikuo/p/9397417.html 4 关于Swagger2和SpringBoot整合使用 https://segmentfault.com/a/1190000018779378 来源: https://www.cnblogs.com/kelelipeng/p/12006201.html

SpringBoot整合Swagger2,再也不用维护接口文档了!

爷,独闯天下 提交于 2019-12-16 02:27:34
前后端分离后,维护接口文档基本上是必不可少的工作。一个理想的状态是设计好后,接口文档发给前端和后端,大伙按照既定的规则各自开发,开发好了对接上了就可以上线了。当然这是一种非常理想的状态,实际开发中却很少遇到这样的情况,接口总是在不断的变化之中,有变化就要去维护,做过的小伙伴都知道这件事有多么头大!还好,有一些工具可以减轻我们的工作量,Swagger2就是其中之一,至于其他类似功能但是却收费的软件,这里就不做过多介绍了。本文主要和大伙来聊下在Spring Boot中如何整合Swagger2。 工程创建 当然,首先是创建一个Spring Boot项目,加入web依赖,创建成功后,加入两个Swagger2相关的依赖,完整的依赖如下: <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> <dependency> <groupId

Swagger2接口文档功能

廉价感情. 提交于 2019-12-16 01:32:15
1、引入pom <!-- Swagger2接口文档 --> < 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 > < dependency > < groupId > com.github.xiaoymin </ groupId > < artifactId > swagger-bootstrap-ui </ artifactId > < version > 1.8.7 </ version > </ dependency > 2、配置类 package com . itennishy . ycweb . config ; import org . springframework . context . annotation . Bean ;

项目使用swagger定义接口

人盡茶涼 提交于 2019-12-14 11:23:19
pom.xml <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.4.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.4.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.4.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.4.0</version> <scope>compile</scope