openapi

How to specify multiple 404 causes in OpenAPI (Swagger)?

回眸只為那壹抹淺笑 提交于 2020-01-11 08:57:09
问题 I'm defining a path for a nested resource (content belonging to a delivery). If the client gets a 404 it could either because the delivery ID was not found, or the delivery did not contain any content of the specified type. How do I model that using OpenAPI (YAML)? I've got this right now... paths: '/deliveries/{id}/content/articles': get: summary: Retrieves articles from a delivery description: Retrieves all articles from a single delivery [...] responses: '200': description: articles found

How to avoid CORS errors (“Failed to fetch” or “Server not found or an error occurred”) when making requests from Swagger Editor?

放肆的年华 提交于 2020-01-10 05:29:09
问题 I have the following OpenAPI definition: swagger: "2.0" info: version: 1.0.0 title: Simple API description: A simple API to learn how to write OpenAPI Specification schemes: - https host: now.httpbin.org paths: /: get: summary: Get date in rfc2822 format responses: 200: schema: type: object items: properties: now: type: object rfc2822: type: string I would like to retrieve rfc2822 from the response: {"now": {"epoch": 1531932335.0632613, "slang_date": "today", "slang_time": "now", "iso8601":

Display Custom HashMap Key Using Swagger Annotations

Deadly 提交于 2020-01-05 04:20:18
问题 I'm trying to generate Swagger documentation from Java code and one of my nested model properties is a HashMap. The generated example for it is as follows: "additionalProp1": { "customObject": {} }, "additionalProp2": { "customObject": {} }, "additionalProp3": { "customObject": {} } What I need it to look like is: "objectName": { "customObject": {} } In other words, I need to tell them what the additionalProp String should be and preferably not have it repeated three times. Is there any way

AWS API Gateway with Lambda Authorizer

僤鯓⒐⒋嵵緔 提交于 2020-01-05 04:13:10
问题 I am trying to configure an API Gateway which takes a proxy parameter from the request path, and also a parameter from the Lambda authorizer return and put it in the header, so that it can be passed to my Elastic Beanstalk REST API running Spring Boot. The proxy path is working as expected; and I see my Lambda function is returning the variable "x-api-auth" in the "context" map as per documentation. The only piece not working is adding "x-api-auth" to the request header. :( Whenever I ran my

How to specify the default XML element text in OpenAPI (Swagger)?

元气小坏坏 提交于 2020-01-04 03:33:25
问题 I'm building an OpenAPI (Swagger) 2.0 definition for the following XML payload to use within the Swagger UI: <addressElement> <key type="RECORD_ID" item="3">Enter value here</key> </addressElement> I'm having an issue figuring out how to display the default value 'Enter value here' for the element key . Where would one place this default value in an OpenAPI definition? My definition looks like this: "definitions": { "addressElement": { "type": "object", "title": "Address Element", "properties

How to specify the default XML element text in OpenAPI (Swagger)?

人走茶凉 提交于 2020-01-04 03:33:02
问题 I'm building an OpenAPI (Swagger) 2.0 definition for the following XML payload to use within the Swagger UI: <addressElement> <key type="RECORD_ID" item="3">Enter value here</key> </addressElement> I'm having an issue figuring out how to display the default value 'Enter value here' for the element key . Where would one place this default value in an OpenAPI definition? My definition looks like this: "definitions": { "addressElement": { "type": "object", "title": "Address Element", "properties

Is there a way to generate a swagger specification file from C++ code?

我与影子孤独终老i 提交于 2020-01-03 08:58:12
问题 I've a requirement to create a HTTP API layer over a legacy API interface written in C++. My plan is to generate the Swagger or open API file and then make it available to bunch of projects that needs to write a client (who will be consumer of new API) or a server (wrapper to legacy API). Is there anything that can expedite this requirement (other than manually parsing them and creating swagger spec file)? i.e. using C++ code to generate swagger JSON/YML file 回答1: Quite late answer and I

Is there a way to generate a swagger specification file from C++ code?

我是研究僧i 提交于 2020-01-03 08:58:11
问题 I've a requirement to create a HTTP API layer over a legacy API interface written in C++. My plan is to generate the Swagger or open API file and then make it available to bunch of projects that needs to write a client (who will be consumer of new API) or a server (wrapper to legacy API). Is there anything that can expedite this requirement (other than manually parsing them and creating swagger spec file)? i.e. using C++ code to generate swagger JSON/YML file 回答1: Quite late answer and I

How to include Http request method name in client method names generated with NSwag

不打扰是莪最后的温柔 提交于 2020-01-03 03:20:07
问题 When I generate a C# client for an API using NSwag, where the API includes endpoints that can be used with multiple Http request types (e.g. POST, GET) the client generates a method for each request with the same base name, plus a number. E.g. Using this API: https://api.premiumfunding.net.au/assets/scripts/swagger/v1/swagger.json The schema contains an endpoint /contract that supports GET and POST requests, and an endpoint /contract/{ID} that supports GET , POST and DELETE requests. The

API Platform - how to document authentication routes

孤者浪人 提交于 2020-01-02 07:21:08
问题 I'm using API Platform v2.2.5 in a Symfony 4 Flex application, consisting of a functioning API with JWT Authentication, a number of resources and the default Open API/Swagger documentation page that is accessible via the /api route. Each API resource is included in the documentation automatically via the platform configuration, as per the library docs. How do you generate documentation for custom operations such as the security component's auth routes? The API Platform Documentation does not