openapi

In Swagger openapi v3.0.0, facing issue in multiple file uploads

空扰寡人 提交于 2020-06-17 15:30:48
问题 Trying to upload multiple files in swagger api. While uploading single file with files: type: string format: binary Getting file in req.files , but when trying for multiple files with files: type: array items: type: string format: binary req.files = null and there is files: '[object file],[object file]' in req.body using nodejs with express 回答1: Uploading an array of files is supported in Swagger UI 3.26.0+ and Swagger Editor 3.10.0+. You need to upgrade your Swagger UI to the latest version.

AWS CDK how to create an API Gateway backed by Lambda from OpenApi spec?

大兔子大兔子 提交于 2020-06-17 02:07:13
问题 I want to use AWS CDK to define an API Gateway and a lambda that the APIG will proxy to. The OpenAPI spec supports a x-amazon-apigateway-integration custom extension to the Swagger spec (detailed here), for which an invocation URL of the lambda is required. If the lambda is defined in the same stack as the API, I don't see how to provide this in the OpenAPI spec. The best I can think of would be to define one stack with the lambda in, then get the output from this and run sed to do a find-and

AWS CDK how to create an API Gateway backed by Lambda from OpenApi spec?

耗尽温柔 提交于 2020-06-17 02:05:11
问题 I want to use AWS CDK to define an API Gateway and a lambda that the APIG will proxy to. The OpenAPI spec supports a x-amazon-apigateway-integration custom extension to the Swagger spec (detailed here), for which an invocation URL of the lambda is required. If the lambda is defined in the same stack as the API, I don't see how to provide this in the OpenAPI spec. The best I can think of would be to define one stack with the lambda in, then get the output from this and run sed to do a find-and

How to require at least one of two parameters in OpenAPI?

梦想与她 提交于 2020-06-08 20:12:27
问题 I'm using OpenAPI 3 and have two query parameters, at least one of which is required but it doesn't matter which. I.e., as sudocode: if parameter_1 OR parameter_2: do stuff else: error Is this possible in OpenAPI 3? There's no mention of it in the spec as far as I can see, or the JSON Schema spec either. 回答1: This scenario is very similar to mutually exclusive parameters. Basically, you can use an object-type parameter where parameter_1 and parameter_2 are the object properties; such object

Swagger Editor 3.8 examples not working for reference array schema

百般思念 提交于 2020-06-01 05:09:05
问题 This question is a follow-up to this similar one - as @Helen requested a new question be asked. It seems an array type schema only accepts "example", not "examples". The following schema produces an error on the editor.swagger.io site: info: title: Example Inc. REST API version 1.0 version: '1.0' openapi: 3.0.0 components: schemas: user_reference: properties: comment: type: string middle_name: type: string domain: pattern: '^[0-9A-Za-z][0-9A-Za-z.-]*$' type: string id: minimum: 1 type:

Swagger Editor 3.8 examples not working for reference array schema

限于喜欢 提交于 2020-06-01 05:09:00
问题 This question is a follow-up to this similar one - as @Helen requested a new question be asked. It seems an array type schema only accepts "example", not "examples". The following schema produces an error on the editor.swagger.io site: info: title: Example Inc. REST API version 1.0 version: '1.0' openapi: 3.0.0 components: schemas: user_reference: properties: comment: type: string middle_name: type: string domain: pattern: '^[0-9A-Za-z][0-9A-Za-z.-]*$' type: string id: minimum: 1 type:

Autorest error - swagger.json' is not a valid OpenAPI 2.0 definition (expected 'swagger: 2.0')

时光总嘲笑我的痴心妄想 提交于 2020-05-23 13:54:25
问题 My api is running net core 3.0 with Swashbuckle.AspNetCore 5.0.0-rc5 When I run autorest on my generated swagger.json file I get: swagger.json is not a valid OpenAPI 2.0 definition (expected 'swagger: 2.0') My swagger.json file does indeed say "openapi": "3.0.1". It used to be v2.0 but since I upgraded to net core 3.0 I had to upgrade Swashbuckle which now creates the json file with v3.0.1 I ran "choco install autorest" so I should be running the latest version If autorest doesn't support

Springfox -> Springdoc: How to expose additional models

末鹿安然 提交于 2020-05-17 07:38:26
问题 I need to expose some models which don't used directly in REST API methods. With springfox I used Docket's additionalModels method to programmatically add models to specification: docket.additionalModels( typeResolver.resolve(XModel1.class), typeResolver.resolve(XModel2.class) ) How to do it with springdoc? Ok, I've created fake operation with fake parameter which includes all required models. But it seems not a cool solution. 回答1: With OpenApiCustomiser , you have access to the OpenAPI

Validate request payloads and responses against a given OpenApi/Swagger specification

非 Y 不嫁゛ 提交于 2020-05-15 04:29:41
问题 We have an HTTP API which is written with the hug framework for Python but this is not set in stone and could be replaced with something else in the future. Next to it, we have manually written an OpenApi/Swagger 2.0 specification file in YAML for that API in order to provide interactive documentation. However, both are not connected to each other by any of the tooling from the Swagger ecosystem - when we make changes in the API, we make the same changes in the specification and vice versa

Validate request payloads and responses against a given OpenApi/Swagger specification

那年仲夏 提交于 2020-05-15 04:29:04
问题 We have an HTTP API which is written with the hug framework for Python but this is not set in stone and could be replaced with something else in the future. Next to it, we have manually written an OpenApi/Swagger 2.0 specification file in YAML for that API in order to provide interactive documentation. However, both are not connected to each other by any of the tooling from the Swagger ecosystem - when we make changes in the API, we make the same changes in the specification and vice versa