swagger

swagger maven plugin documentation is not generated

…衆ロ難τιáo~ 提交于 2019-12-11 04:28:02
问题 I am trying to generate swagger documentation using Swagger maven plugin But nothing is created, this is plugin in details I entered: <plugin> <groupId>io.swagger</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> <version>2.2.2-SNAPSHOT</version> <executions> <execution> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec>/data/AMEE/ame/api.yaml</inputSpec> <language>java</language> <configOptions> <sourceFolder>/data/AMEE/ame/gen</sourceFolder> </configOptions> <

How to debug error 500 in Swashbuckle 5 for ASP.Net

大兔子大兔子 提交于 2019-12-11 04:20:59
问题 I'm getting an error 500 back from Swashbuckle/Swagger, and contrary to the best related answer I could find, I'm not seeing any additional information in the error response. I manually tracked down the problem endpoints by trial-and-error commenting out controllers and actions until I isolated the bad ones, but this is slow and doesn't tell me why certain endpoints have a problem. What can I do to get meaningful debug information for the Swagger/Swashbuckle errors? I'm using Swashbuckle 5.6

swagger-ui集成

柔情痞子 提交于 2019-12-11 04:02:53
swagger-ui集成 相信无论是前端还是后端开发,都或多或少地被接口文档折磨过。前端经常抱怨后端给的接口文档与实际情况不一致。后端又觉得编写及维护接口文档会耗费不少精力,经常来不及更新。其实无论是前端调用后端,还是后端调用后端,都期望有一个好的接口文档。但是这个接口文档对于程序员来说,就跟注释一样,经常会抱怨别人写的代码没有写注释,然而自己写起代码起来,最讨厌的,也是写注释。所以仅仅只通过强制来规范大家是不够的,随着时间推移,版本迭代,接口文档往往很容易就跟不上代码了。 swagger简介 Swagger是一款RESTFUL接口的文档在线自动生成+功能测试功能软件。Swagger是一个规范和完整的框架,用于生成、描述、调用和可视化RESTfu风格的web服务。目标是使客户端和文件系统作为服务器一同样的速度来更新文件的方法,参数和模型紧密集成到服务器。这个解释简单点来讲就是说,swagger是一款可以根据restful风格生成的接口开发文档,并且支持做测试的一款中间软件。 swagger-ui集成步骤 (在一个现有的springboot项目中集成测试的,不要在意包路径以及类的名称) 1、集成swagger相关依赖 < ! -- swagger - api 依赖开始 -- > < dependency > < groupId > io . springfox < / groupId

CXF Swagger2Feature adding securityDefinitions

帅比萌擦擦* 提交于 2019-12-11 03:54:16
问题 I want to add Security Definition to my rest service using org.apache.cxf.jaxrs.swagger.Swagger2Feature. However I can not see any related method or any resource on how to do it. Below is the swagger doc which I want to generate using swagger2feature. How can I do it? swagger: '2.0' info: version: 1.0.0 title: Based on "Basic Auth Example" description: > An example for how to use Auth with Swagger. host: basic-auth-server.herokuapp.com schemes: - http - https securityDefinitions: Bearer: type

Create a swagger/open API response with array of un-named objects

梦想的初衷 提交于 2019-12-11 02:59:22
问题 I get the response from an http request in the following form: it is an array of un-named array(s) and object(s). I cannot figure out the proper Swagger (Open API) specification for this case. [ [ { "prop1": "hello", "prop2": "hello again" }, { "prop1": "bye", "prop2": "bye again" } ], { "key": 123 } ] 回答1: The answer depends on which version of OpenAPI you use. OpenAPI 3.0 supports oneOf , so it's possible to define multiple schemas for array items: openapi: 3.0.0 ... paths: /something: get:

Swagger composition / inheritance

大城市里の小女人 提交于 2019-12-11 02:46:38
问题 I'm trying to document a REST API using Swagger. A simplified JSON response from our API looks like: { "data": { "type": "person" "id": "1" "attributes": { "name": "Joe" "age": 32 ... } "links": { ... } } } or { "data": { "type": "job" "id": "22" "attributes": { "name": "Manager" "location": "Somewhere" ... } "links": { ... } } } Their Swagger definitions for a successful GET might look like: '200': description: OK. schema: type: object properties: data: type: object properties: id: type:

NoSuchMethodError: com.sun.jersey.core.reflection.ReflectionHelper.getOsgiRegistryInstance()Lcom/sun/jersey/core/osgi/OsgiRegistry;

陌路散爱 提交于 2019-12-11 02:17:26
问题 It seems I have a dependency conflict that I'm unsure how to resolve. I'm attempting to implement Swagger into my application. I've included my pom as well as the stack trace. If I can include anything else to better describe the problem, please let me know. I'm unsure how to begin debugging this... Exception in thread "main" java.lang.NoSuchMethodError: com.sun.jersey.core.reflection.ReflectionHelper.getOsgiRegistryInstance()Lcom/sun/jersey/core/osgi/OsgiRegistry; at com.sun.jersey.spi

Use multiple Json files in swagger-ui

拟墨画扇 提交于 2019-12-11 02:13:22
问题 I am using Swagger-ui version 2.1.4, i have hosted it locally and provided it my own Json file and API it opens the document fine and lists all the method in the json file, but the json file become very big, i want to use multiple json files and want to open one at a time, i do not know how to provide it multiple json files and use them, because the single file i have provided it in the index page was like this: var url = window.location.search.match(/url=([^&]+)/); if (url && url.length > 1)

ServiceStack: No /swagger-ui/index.html

橙三吉。 提交于 2019-12-11 02:07:30
问题 I am using ServiceStack for my custom service, in stand alone mode without IIS. I would like to add documentation for my services beyond what /metadata does. I thought to try the Swagger plug in. I have added the plug-in command to my Config public override void Configure(Funq.Container container) { SetConfig(new EndpointHostConfig() { DefaultRedirectPath = "index.html", DebugMode = true, WriteErrorsToResponse = true, CustomHttpHandlers = { { HttpStatusCode.Unauthorized, new

How to integrate Swagger no config setup with Jersey 2

核能气质少年 提交于 2019-12-11 02:04:33
问题 I'm trying to do a barebones Swagger setup with a Jersey 2 project hosted on Tomcat 8.5. I first generated the jersey project with the following snippet from the Jersey getting started guide (https://jersey.github.io/documentation/latest/getting-started.html): mvn archetype:generate -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeGroupId=org.glassfish.jersey.archetypes -DinteractiveMode=false -DgroupId=com.example -DartifactId=simple-service-webapp -Dpackage=com.example \