swagger

How to document function-based views parameters?

倾然丶 夕夏残阳落幕 提交于 2019-12-24 03:30:43
问题 I'm developing a REST API with Django 1.11 and Django REST Framework 3.7. I installed Django REST Swagger 2.1 to generate the documentation. I'm using a function-based view like this: from rest_framework.decorators import api_view, permission_classes @api_view(['POST']) @permission_classes((permissions.AllowAny,)) def jwt_auth(request, provider, format=None): """ View description here """ pass As you can see, my view is recognized by Swagger and it has the correct description: " View

OpenApi/Swagger - What is the difference between Client and Server?

我与影子孤独终老i 提交于 2019-12-24 03:28:13
问题 I've built a RESTful service exposing an endpoint using OpenApi 3.0 using yaml When I build this, it auto-generates a client directory and a server directory. I am successfully leveraging the server API as an endpoint which consumes requests. However the client API is generated from exactly the same yaml ...accepting the same argument type and returning the same type as the server. My understanding was a client produces requests to an external service, while a server consumes requests from an

Advice about Swagger API

孤者浪人 提交于 2019-12-24 02:18:09
问题 I'm building an API using SpringBoot and Spring REST services using Java 8. I've just discovered Swagger API and now I would like to make my API Swagger compliant. As far I read, Swagger is a tool to document your APIS, but also provides functionalities to generate the client and server code from an specification (swagger.json in v2), besides of a nice web interface to interact with your API. Now, I would like some recommendations about how to proceed, given that I already have an existing

Go structs to OpenAPI to JSONSchema generation automatically

蹲街弑〆低调 提交于 2019-12-24 01:29:15
问题 I have a Go struct for which I want to generate an OpenAPI schema automatically. Once I have an OpenAPI definition of that struct I wanna generate JSONSchema of it, so that I can validate the input data that comes and is gonna be parsed into those structs. The struct looks like the following: // mySpec: io.myapp.MinimalPod type MinimalPod struct { Name string `json:"name"` // k8s: io.k8s.kubernetes.pkg.api.v1.PodSpec v1.PodSpec } Above struct is clearly an augmentation of what Kubernetes

Override Swagger sorting

浪子不回头ぞ 提交于 2019-12-24 01:27:31
问题 I want to organize my swagger api in reverse alphabetical order but it defaults to alphabetical. Is there a simple way to do this? Specifically using Swashbuckle.Core 5.2.1 回答1: You can create a sorter for the UI for both the operations ( operationsSorter ) and tags ( apisSorter ). 来源: https://stackoverflow.com/questions/33746676/override-swagger-sorting

beego配置文件

 ̄綄美尐妖づ 提交于 2019-12-24 01:27:13
关于App配置: #App配置 for Api AppName = ApiService RunMode = dev RouterCaseSensitive = true ServerName = ApiService RecoverPanic = true CopyRequestBody = true EnableGzip = false MaxMemory = 1 << 26 EnableErrorsShow = true EnableErrorsRender = false AppName 应用名称,通过 bee new 创建的项目名 AppName = beego beego.BConfig.AppName = "beego" RunMode 可选 prod 、 dev 、 test 。默认 dev 为开发模式有日志打印, prod 会关闭日志的打印, test 测试模式还没用过 RunMode = dev beego.BConfig.RunMode = "dev" RouterCaseSensitive 路由忽略大小写匹配,默认为true,意思是不需要刻意配置 RouterCaseSensitive = true beego.BConfig.RouterCaseSensitive = true ServerName beego 服务器默认在请求的时候输出 server 为

Swagger UI displaying the asp.net webapi parameter name with dot notation

≯℡__Kan透↙ 提交于 2019-12-24 00:59:07
问题 I have configured Swagger for my asp.net webapi which is similar to one shown below [HttpGet] [Route("search")] public async Task<HttpResponseMessage> Get([FromUri]SearchCriteria searchCriteria) When i see the swagger documentation for the webapi , the parameter is displaying as searchCriteria.sortField searchCriteria.sortDirection and so on... being the sortField, sortDirection are properties of SearchCriteria How to get the parameter names without the object.propertyname format? Can anyone

Swagger Parameters and Complex Types

你说的曾经没有我的故事 提交于 2019-12-24 00:45:35
问题 In the following Swagger definition, I need the parameter labelValue to be of type LabelValueObject , so that it will be validated and correctly deserialized. However, I can't figure out the syntax! How can that be done? swagger: "2.0" paths: /competition: post: parameters: - name: labelValue in: formData type: array items: type: string ### this has to be a LabelValueObject ### responses: default: description: Error schema: $ref: "#/definitions/AnyResponse" definitions: AnyResponse:

Swagger - Set the “response” based on “consumes”

筅森魡賤 提交于 2019-12-24 00:38:16
问题 Is it possible to specify the "response" based on the "consumes" option on Swagger? My API can return "json" or "text" and I'd like that the "example value", when the response's status is 200 changes if the user selects from Response Content Type the option application/json or text/plain . This is a piece of my swagger.json file: { "swagger": "2.0", "produces": [ "application/json", "text/plain" ], "consumes" : [ "application\/json" ], "paths": { "/writer/1/": { "get": { "summary": "Get all

Can I use swagger test template with non nodejs app?

纵饮孤独 提交于 2019-12-23 22:52:09
问题 I'm working in building out a api test suite for a php application. Right now the app is using swagger annotation and I can easily create a swagger.json. But from looking at the swagger test template, it looks like I have to create a nodejs app first using swagger node? Is there a way I can skip that step and use my php app instead? Edit: I already have the swagger docs up and running using swagger-php. Just wondering if it's possible to use swagger-test-template without using swagger-node.