swagger

.NET Core 2.1 Swashbuckle - group controllers by area

天大地大妈咪最大 提交于 2021-02-09 20:29:51
问题 My situation is rather simple. I have a very large .NET Core 2.1 MVC/WebApi divided into several Areas, representing different modules of my system. I use Swagger (SwashBuckle) and it works very well. My routing are like {area}/{controller}/{action} . In Swagger UI, every action is grouped into the controllers (standard behaviour). My list of controllers and operations is becoming very very large and hard to grasp. Because of that, i would love if Swagger could divide my controllers into the

idea查看jar冲突和解决方法

半城伤御伤魂 提交于 2021-02-09 19:03:56
选中Dependencies,点上边那个按钮,出现下图 依赖图太小了,根本没法看啊?好办,点击鼠标右键,呼出右键菜单栏,然后点击 Actual Size : 如果我们仔细观察上图,会发现在项目依赖图中,有一些红色标记的线,实际上,这些红色标记出来的线所指向的 jar 包,就是项目中冲突的 jar 包!且在我们点击 jar 包之后,还会显示出多条指向 jar 包的红色虚线,其代表着该 jar 包被多次引用,及具体引用路径 解决方案 方案1、点击冲突的 jar 包,右键呼出菜单栏,点击 Exclude 选项。 在排除冲突的 jar 包之后, pom.xml 文件会自动更新,添加排除语句。 方案2、排除所有,在外提供一个最高版本的依赖 例如 com.google.guava冲突了 在引入swagger的maven依赖时 <!-- swagger --> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.7.0</version> <exclusions> <exclusion> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> </exclusion> <

restful文档神器 swagger (1)

末鹿安然 提交于 2021-02-09 11:35:10
功能 自动的在代码中分析REST接口,生成REST接口描述JSON。这个JSON又可以被客户端生成文档,以及测试用的WEB页。 例如: 我有这么一个接口: @RequestMapping(value="/{name}", method = RequestMethod.GET)@ResponseBodypublic Movie getMovie(@PathVariable String name) swagger加入以后,会自动生成这样的描述: { "apiVersion": "1.0", "swaggerVersion": "1.0", "basePath": "http://localhost:8080", "resourcePath": "/movie", "apis": [ { "path": "/movie/{name}", "description": "", "operations": [ { "httpMethod": "GET", "summary": "get Movie", "notes": "", "deprecated": false, "responseClass": "Movie", "nickname": "getMovie", "parameters": [ { "name": "name", "description": "name",

restful文档神器 swagger (2)

末鹿安然 提交于 2021-02-09 11:10:16
主要参考: http://blog.zenika.com/index.php?post/2013/07/11/Documenting-a-REST-API-with-Swagger-and-Spring-MVC http://www.3pillarglobal.com/insights/restful-api-documentation-using-swagger-and-spring-mvc 步骤: 先借一个Spring MVC的工程代码 http://www.mkyong.com/spring-mvc/spring-3-rest-hello-world-example/ 修改pom.xml 加入jetty <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.2.2.v20140723</version> </plugin> mvn jetty:run试下可以跑起来 加入swagger-springmvc <dependency> <groupId>com.mangofactory</groupId> <artifactId>swagger-springmvc</artifactId> <version>0.5.2</version

Invalid model schema specified for swagger

烈酒焚心 提交于 2021-02-09 10:57:56
问题 I tried to deploy API on AWS but it not allowed to add a model in the JSON file and shows error : It working without the use of model so maybe it not take model this way so please suggest me how to use a model in API JSON on AWS! Error is : Your API was not imported due to errors in the Swagger file. Unable to create model for 'LandingPageDTO': Invalid model specified: Validation Result: warnings : [], errors : [Invalid model schema specified] Unable to put method 'POST' on resource at path '

Invalid model schema specified for swagger

≡放荡痞女 提交于 2021-02-09 10:57:08
问题 I tried to deploy API on AWS but it not allowed to add a model in the JSON file and shows error : It working without the use of model so maybe it not take model this way so please suggest me how to use a model in API JSON on AWS! Error is : Your API was not imported due to errors in the Swagger file. Unable to create model for 'LandingPageDTO': Invalid model specified: Validation Result: warnings : [], errors : [Invalid model schema specified] Unable to put method 'POST' on resource at path '

Invalid model schema specified for swagger

旧城冷巷雨未停 提交于 2021-02-09 10:57:07
问题 I tried to deploy API on AWS but it not allowed to add a model in the JSON file and shows error : It working without the use of model so maybe it not take model this way so please suggest me how to use a model in API JSON on AWS! Error is : Your API was not imported due to errors in the Swagger file. Unable to create model for 'LandingPageDTO': Invalid model specified: Validation Result: warnings : [], errors : [Invalid model schema specified] Unable to put method 'POST' on resource at path '

How can I denote decimal floating point in swagger specs?

ぃ、小莉子 提交于 2021-02-08 13:53:55
问题 I would like to denote decimal with 2 places and decimal with 1 place in my api documentation. I'm using swagger 2.0, Is there inbuilt defined type or any other 'round' parameter in the specs, or my only option is to use 'x-' extension? 回答1: OpenAPI (fka Swagger) Specification uses a subset of JSON Schema to describe the data types. If the parameter is passed as a number, you can try using multipleOf as suggested in this Q&A: type: number multipleOf: 0.1 # up to 1 decimal place, e.g. 4.2 #

Create one code client / flatten controllers with NSwag and AutoREST

巧了我就是萌 提交于 2021-02-08 10:55:49
问题 I'm trying to create a code wrapper for an api with NSwag and Autorest. Previously I was using Swashbuckle to generate the swagger file. It generated the swagger file with operationIds in the format actionMethod . This resulted in Autorest generating a code client that was 1-deep. All of the actions were on the top-level class. For various reasons, I needed to change swagger generation to NSwag. This generates operationIds in the format controller_actionMethod . This results in AutoRest

Swagger UI doesn't support uploading a file properly for RestEasy

╄→尐↘猪︶ㄣ 提交于 2021-02-08 10:18:33
问题 I use a JAX-RS (RestEasy) along with a Swagger. One of my endpoint can upload a file. Defined way to upload the file (in RestEasy) is to provide a org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput as a parameter. Here is my endpoint: @PUT @Path("/apis/{id}/file") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Registers a file.", code = 201, nickname = "registerFile") @ApiResponses( value = { @ApiResponse(code = 201,