swagger

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 convert java class to json format structure without creating object

本小妞迷上赌 提交于 2020-06-16 08:54:10
问题 I need to document multiple microservices api call,so I have a question that how to create json string out of java pojo class directly. I mean say for example , MyPojo.java public class MyPojo { String name; List<String> address; public MyPojo() { // TODO Auto-generated constructor stub } //setters and getters } now I need the string json structure of the pojo without creating object of the class.May be same the way swagger api creates json structure of @RequestBody object in web UI.

How to convert java class to json format structure without creating object

旧时模样 提交于 2020-06-16 08:52:28
问题 I need to document multiple microservices api call,so I have a question that how to create json string out of java pojo class directly. I mean say for example , MyPojo.java public class MyPojo { String name; List<String> address; public MyPojo() { // TODO Auto-generated constructor stub } //setters and getters } now I need the string json structure of the pojo without creating object of the class.May be same the way swagger api creates json structure of @RequestBody object in web UI.

Does springfox-swagger2 UI support choosing multiple files at once?

主宰稳场 提交于 2020-06-16 08:31:33
问题 I use Spring Boot and integrated swagger-ui (springfox-swagger2) and I want to be able to choose to upload multiple files at once. Unfortunately the Swagger UI doesn't appear to allow this, at least not give my controller method. My controller method signature: @ApiOperation( value = "batch upload goods cover image", notes = "batch upload goods cover image", response = UploadCoverResultDTO.class, responseContainer = "List" ) public Result<?> uploadGoodsCover(@ApiParam(value = "Image array",

Swashbuckle - swagger documentation of returned response?

空扰寡人 提交于 2020-06-13 20:04:00
问题 Swashbuckle would not generate swagger.json with an output of "UserCreateResponse", how do you fix this? [HttpPost] public async Task<IActionResult> Update([FromBody]UserCreate Request) { UserCreateResponse response = new UserCreateResponse(); //do something here // returns UserCreateResponse with http status code 200 return Ok(response); } You can't do this, because its not going to return the http status code, 200,400,401 etc [HttpPost] public async Task<UserCreateResponse> Update([FromBody

Swashbuckle - swagger documentation of returned response?

时光毁灭记忆、已成空白 提交于 2020-06-13 20:03:13
问题 Swashbuckle would not generate swagger.json with an output of "UserCreateResponse", how do you fix this? [HttpPost] public async Task<IActionResult> Update([FromBody]UserCreate Request) { UserCreateResponse response = new UserCreateResponse(); //do something here // returns UserCreateResponse with http status code 200 return Ok(response); } You can't do this, because its not going to return the http status code, 200,400,401 etc [HttpPost] public async Task<UserCreateResponse> Update([FromBody

How to customize the value of operationId generated in api spec with swagger?

回眸只為那壹抹淺笑 提交于 2020-06-12 04:31:06
问题 I have configured my spring project using springfox 2.0. I am able to generate the open api spec with it. "paths": { "/test/testinfo": { "post": { "tags": [ "test-controller" ], "summary": "getTestInfo", "operationId": "getTestInfoInfoUsingGET", "consumes": [ "application/json" ], "produces": [ "application/json" ] As you can see the value of operationId is of format [java_method_name_here]Using[HTTP_verb_here] ex. getPetsUsingGET This operationId is used while generating clients using

How to set up Swashbuckle vs Microsoft.AspNetCore.Mvc.Versioning

丶灬走出姿态 提交于 2020-06-09 09:28:26
问题 We have asp.net core webapi. We added Microsoft.AspNetCore.Mvc.Versioning and Swashbuckle to have swagger UI. We specified controllers as this: [ApiVersion("1.0")] [Route("api/v{version:apiVersion}/[controller]")] public class ContactController : Controller { When we run swagger ui we get version as parameter in routes: How to set-up default "v1" for route ? If version 2 come to the stage how support swagger ui for both versions ? 回答1: At the moment Swashbuckle and Microsoft.AspNetCore.Mvc

How to set up Swashbuckle vs Microsoft.AspNetCore.Mvc.Versioning

﹥>﹥吖頭↗ 提交于 2020-06-09 09:28:22
问题 We have asp.net core webapi. We added Microsoft.AspNetCore.Mvc.Versioning and Swashbuckle to have swagger UI. We specified controllers as this: [ApiVersion("1.0")] [Route("api/v{version:apiVersion}/[controller]")] public class ContactController : Controller { When we run swagger ui we get version as parameter in routes: How to set-up default "v1" for route ? If version 2 come to the stage how support swagger ui for both versions ? 回答1: At the moment Swashbuckle and Microsoft.AspNetCore.Mvc