swagger

Swagger dependency not recognized by maven

蓝咒 提交于 2019-12-11 01:59:35
问题 i'm trying to add springfox/swagger to my spring boot app, however when added to pom file, versions of dependencies are not recognized by maven. Unfortunatley i couldn't find the reason behind it. Here fragment of my pom file: <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.0.2</version> </dependency> Versions are

Swagger not working

为君一笑 提交于 2019-12-11 01:45:15
问题 I'm having a bit of trouble making Swagger display API docs using Restlet. What Swagger shows is just these stuff: And checking the api-docs it only shows this: I wonder what is wrong with my code: public class MyApplication extends SwaggerApplication { private static final String ROOT_URI = "/"; public Restlet createInboundRoot() { Router router = new Router(getContext()); router.attach(ROOT_URI, RootServerResource.class); router.attach(ROOT_URI + "ping", PingServerResource.class); router

Does Django Rest Framework have third party apps to auto generate swagger.yaml file?

只谈情不闲聊 提交于 2019-12-11 01:23:35
问题 I have large amount of API endpoints written in django-rest-framework and it keeps increasing and updating. How can I create & maintain API documentation that should be up-to-date? My current version is Create swagger.yaml file and somehow auto generate everytime any endpoint changes. Then use this file as an input to readme.io, ReDoc or other alternatives to provide visualization to external folks. If you have an experience on this or any similar solution, please share I really appreciate it

Hiding fields in Example Value but not in Model of Request Body in Swagger UI

久未见 提交于 2019-12-11 00:57:07
问题 We are trying to achieve a scenario on the Swagger UI in the Body section. In the Requests section, can we have an Example Value JSON hiding one or more fields but the Model would still show those fields? We are basically trying to reduce the number of fields in the request body but have all the fields visible in the Model. For example, we would like to hide the name in the example here: but still display the name in the Model here: 回答1: To hide fields from auto-generated model examples in

Swagger generated REST API docs showing query params as required (but I want not-required)

被刻印的时光 ゝ 提交于 2019-12-11 00:56:51
问题 I am generating swagger docs for my REST API. The generated docs show the params are required . How to make them not-required in swagger ? In actual REST invocations they are not-required (as expected); so problem is just in documentation. import javax.ws.rs.*; @GET @Produces(MediaType.APPLICATION_JSON) public Response getBaz( @DefaultValue("false") @QueryParam("foo") final boolean myFoo, @DefaultValue("") @QueryParam("bar") final String myBar ) { ... } The generated swagger.json has ...

AWS API Gateway and Lambda function deployed through terraform — Execution failed due to configuration error: Invalid permissions on Lambda function

若如初见. 提交于 2019-12-11 00:34:48
问题 I'm deploying an API gateway and a Lambda function together through Terraform, and the Lambda function is meant to be triggered by the API Gateway. After the resources successfully deploy, I test the API Gateway and I get response: { "message": "Internal server error" } . The actual logs of the API gateway say: Execution failed due to configuration error: Invalid permissions on Lambda function I can get the actual api-lambda functionality to work by going to the integration request section of

Two paths for the same method

▼魔方 西西 提交于 2019-12-10 23:20:21
问题 Been trying to use Swagger to generate my documentation for my PHP Rest API, using swagger-php. It's working pretty great, not quite sure if I'm a fan of having huge comment blocks due to the documentation, but that's not the issue. I have two paths: /user/ [POST] /user/login [POST] Both of them call the same method in my PHP code: login(). Is there a way for me to say that /user/ [POST] is just an alias of /user/login [POST] ? I'd like both of them to be present in the list of Operations,

How to prevent xml-wrapper element in Swagger-ui

廉价感情. 提交于 2019-12-10 23:07:33
问题 I am using swagger-ui version 2.2.8 Our existing API can produce application/json as well as application/xml. For a single record result in json it produces: { "person": { "id": 23, "name": "John" } } and for XML it produces: <person> <id>23</id> <name>John</name> </person> My swagger-schema for this is: { "person": { "type": "object", "properties": { "person": { "$ref": "#/definitions/personfields" } } } } When viewed in swagger-ui the json model is looking fine. However the XML-model

Swagger generator doesn't recognize controller

一曲冷凌霜 提交于 2019-12-10 22:49:15
问题 I have this yaml file: --- swagger: "2.0" info: version: 0.1.0 title: "My API" host: localhost:3000 basePath: /api schemes: - http paths: /weather: get: x-swagger-router-controller: "weatherController" description: "Returns current weather in the specified city to the caller" operationId: getWeather parameters: - name: city in: query description: "The city you want weather for in the form city,state,country" required: true type: "string" When I run swagger-codegen-cli, generates /api/Default

Swagger-Net Shows controller name instead of endpoint method

淺唱寂寞╮ 提交于 2019-12-10 22:01:21
问题 I've been trying to figure out why Swagger-Net does not show the endpoint methods in a controller. The C# project is using a Web API template based on .Net framework 4.6.1. I get the same result when I use SwashBuckler, so it's not Swagger-Net that's the issue, but something that is not configured or missing. The SwaggerConfig looks like this public class SwaggerConfig { /// <summary> /// /// </summary> public static void Register() { var thisAssembly = typeof(SwaggerConfig).Assembly;