openapi

Swagger/OpenAPI 3.0 issue with example on responses

时光总嘲笑我的痴心妄想 提交于 2020-01-02 07:15:09
问题 This is a simplified version of my OpenAPI 3.0 definition I'm viewing on the Swagger Editor online. I am trying to have the two responses for error codes 401 and 403, that share the same schema, show different examples - this doesn't seem to work and I still see the referenced type as example. Can you help me figuring out what's wrong with the definitions? openapi: 3.0.0 info: version: '1.0' title: A service paths: /doSomething: post: requestBody: content: application/json: schema: type:

How to describe this POST JSON request body in OpenAPI (Swagger)?

心已入冬 提交于 2019-12-29 03:32:53
问题 I have a POST request that uses the following JSON request body. How can I describe this request body using OpenAPI (Swagger)? { "testapi": { "testapiContext": { "messageId": "kkkk8", "messageDateTime": "2014-08-17T14:07:30+0530" }, "testapiBody": { "cameraServiceRq": { "osType": "android", "deviceType": "samsung555" } } } } So far I tried the following, but I'm stuck at defining the body schema . swagger: "2.0" info: version: 1.0.0 title: get camera license: name: MIT host: localhost

How to document dynamic query parameter names in OpenAPI (Swagger)?

家住魔仙堡 提交于 2019-12-28 04:26:19
问题 Is there any way to document the following query? GET api/v1/users?name1=value1&name2=value where the query parameter names are dynamic and will be received from the client. I'm using the latest Swagger API. 回答1: Free-form query parameters can be described using OpenAPI 3.0, but not OpenAPI 2.0 (Swagger 2.0). The parameter should have type: object with the serialization method style: form and explode: true . The object will serialized as ?prop1=value1&prop2=value2&... , where individual prop

Is there a way to convert an OpenAPI specification to a spring cloud contract?

非 Y 不嫁゛ 提交于 2019-12-24 23:44:14
问题 I'm trying to convert an openAPI specification (written in yaml) into a spring cloud contract YAML DSL. Is there any plugin that could do this type of conversion? 回答1: Yes you can. Please read this blog post on how to encorporate the yaml contract inside the openapi spec https://springframework.guru/defining-spring-cloud-contracts-in-open-api/ 来源: https://stackoverflow.com/questions/56989445/is-there-a-way-to-convert-an-openapi-specification-to-a-spring-cloud-contract

“Request body” doesn't appears on Swagger UI

青春壹個敷衍的年華 提交于 2019-12-24 20:04:23
问题 I'm trying to do a test with a POST request on my Swagger Documentation, but I'm having the following trouble: On Swagger Editor I can test it normally, but on Swagger UI the Request body field doesn't appears, so I can't put my email and password to test the request. Here you can see the Request body field with data examples ready to be edited: Swagger Editor Example And here you can see that Swagger UI doesn't shows it: Swagger UI Example Note: I've generated a nodejs-server . My .yaml code

How Can I add basic auth in swagger 3.0 automatically with out the user to type in at authorize button?

前提是你 提交于 2019-12-24 12:00:38
问题 I am using swagger 3.0 and have multiple endpoints in swagger docs. I want user not to type in credentials at authorize button every time. Is there any way I can include authentication in index.html or in my yaml files to automatically authorize the user. Thanks. 回答1: Swagger UI 3.13.0+ provides the preauthorizeBasic method for this purpose. Assuming your API definition includes a security scheme for Basic auth: swagger: '2.0' ... securityDefinitions: basicAuth: type: basic security: -

Open API inherited example data

馋奶兔 提交于 2019-12-24 11:37:50
问题 I'm using OpenAPI 3.0 to define an API for a service I am building. I'm running into an issue reusing schema components inside other components. For example, I have a Note object which contains a Profile object of the person who created the note. This works as expected by referencing the Profile object using the $ref keyword. The issue is when showing the example there isn't any data for the profile, and if I place the ref in the example like below it includes the actual OpenAPI block of

How to send a JSON object as part of a multipart request in Swagger Editor?

谁说胖子不能爱 提交于 2019-12-24 09:07:35
问题 I'm writing API documentation using Swagger Editor, but having a problem with a multipart POST request containing a JSON object. Here is my Swagger YAML file: swagger: '2.0' info: version: 1.0.0 title: Documentation API paths: /agent: post: consumes: - multipart/form-data produces: - text/html parameters: - in: query name: method description: name of method to access required: true type: string - in: body name: param description: parameter to send required: true schema: $ref: "#/definitions

spring boot 2.2 cannot serve swagger-resources when used with springdoc-openapi

雨燕双飞 提交于 2019-12-24 08:04:03
问题 https://www.dariawan.com/tutorials/spring/documenting-spring-boot-rest-api-springdoc-openapi-3/ According to this, using springdoc openapi dependencies should pull in swagger3 I am using <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-ui</artifactId> <version>1.2.15</version> </dependency> <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-webmvc-core</artifactId> <version>1.2.15</version> </dependency> The swaggerui page looks for swagger

Swagger Format for PayPal Payment API

我们两清 提交于 2019-12-24 07:35:08
问题 I'm new to OpenAPI and I need some help to create a basic swagger file for PayPal's payment API to create a payment from our platform. Note : OAuth is already configured. Below is a basic swagger file but I don't know where to add the paymet request information (i.e. intent, payer, transactions etc.) into: { "swagger": "2.0", "info": { "description": "this is a payment request to through PayPal", "title": "Swagger PayPal Payment", "version": "1.0.0" }, "host": "api.sandbox.paypal.com",