swagger-2.0

Is there any possible way to define same path multiple times with change in parameters?

送分小仙女□ 提交于 2020-02-24 14:40:57
问题 I need to define a service that is used multiple times with change in parameters.I need to define this multiple times but whenever I define it second time it automatically overwrites the previous one. Following is how I defined it.This is first definition: /sevice : post: summary: Service ABC description: | This service is used to get ABC. parameters: - name: XYZ in: query description: '8' required: true type: number format: integer - name: LMN in: query description: '2' required: true type:

How do I automatically authorize all endpoints with Swagger UI?

☆樱花仙子☆ 提交于 2020-02-24 05:42:55
问题 I have an entire API deployed and accessible with Swagger UI. It uses Basic Auth over HTTPS, and one can easily hit the Authorize button and enter credentials and things work great with the nice Try it out! feature. However, I would like to make a public sandboxed version of the API with a shared username and password, that is always authenticated; that is, no one should ever have to bring up the authorization dialog to enter credentials. I tried to enter an authorization based on the answer

Spring boot 2.2.0 Spring HateOas startup issue

六眼飞鱼酱① 提交于 2020-02-21 12:29:07
问题 I moved my project from spring boot 2.1.9 to 2.2.0. While starting the project am facing the below error messages. What could have caused, am not using hateoas in my pom.xml file either. Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.springframework.plugin.core.PluginRegistry<org.springframework.hateoas.client.LinkDiscoverer, org.springframework.http.MediaType>' available: expected single matching bean but found 17:

How to hide endpoints from Swagger documentation in Spring Boot

你离开我真会死。 提交于 2020-02-21 12:02:26
问题 I have a Spring Boot project with next dependency of Swagger: <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.9.2</version> </dependency> And I have my Interface: import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind

Write swagger doc that consumes multiple content types e.g. application/json AND application/x-www-form-urlencoded (w/o duplication)

好久不见. 提交于 2020-02-19 06:01:23
问题 I'm looking for an elegant way to define an api that can consume JSON data as well as form data. The following snippet works, but it's not elegant and requires all kind of ugly code in the backend. Is there a better way to define this? What works right now: paths: /pets: post: consumes: - application/x-www-form-urlencoded - application/json parameters: - name: nameFormData in: formData description: Updated name of the pet required: false type: string - name: nameJSON in: body description:

How to specify columns in Swagger

≯℡__Kan透↙ 提交于 2020-02-04 09:02:24
问题 How to specify 3 columns in a swagger editor so the output should look like: a b c x y z swagger: '2.0' info: description: > This is a sample server Petstore server. [Learn about Swagger](http://swagger.io) or join the IRC channel `#swagger` on irc.freenode.net. For this sample, you can use the api key `special-key` to test the authorization filters **Here I want to specify 3 columns** 回答1: This is essentially a Markdown question. To make a table in Markdown use a tool like this or following

“No operations defined in spec” Error while using RestEasy FrameWork with Swagger

流过昼夜 提交于 2020-02-01 08:54:12
问题 I have implemented REST apis using RESTEASY framework I am trying to implement swagger api documentation through web.xml i am able to get index.html but error is thrown that can't read from file. am I making mistake in making URL? my web.xml is as follows: <servlet> <servlet-name>swagger-servlet</servlet-name> <servlet-class>com.wordnik.swagger.jersey.config.JerseyJaxrsConfig</servlet-class> <init-param> <param-name>api.version</param-name> <param-value>1.1.0</param-value> </init-param> <init

swagger: file path in path parameter

眉间皱痕 提交于 2020-01-25 20:36:08
问题 Here is my api requirement GET http://localhost:8080/filePath/{path} For example: curl http://localhost:8080/filePath/home/users/user/one.txt Here is yaml config: parameters: - name: path in: path description: Todo description type: string required: true But I'm getting 404 error. How can I use file path in path parameter? 回答1: OpenAPI 2.0 (Swagger 2.0) and OpenAPI 3.0 do not allow you to use slashes in path parameters, so you can't do that. There's an open feature request for this: https:/

Swagger UI support for overloaded methods (springfox-swagger-ui 2.9.0 - RFC6570)

拜拜、爱过 提交于 2020-01-25 10:17:11
问题 Problem/Scenario I have a basic REST API project with SpringBoot 1.4.7.RELEASE and I'm using springfox/swagger for documentation. We started couple years ago using io.springfox:springfox-swagger2:2.9.0 io.springfox:springfox-swagger-ui:2.9.0 Any given day we'd replaced springfox-swagger-ui by its /dist folder and some customizations were applied. So far so forth, everything was fine. Now, I'm doing method overloading in @RestController for the same endpoint/HTTP verb and that is not really

Upgraded spring boot from 2.1.0 to 2.2.2.RELEASE , now getting exception while starting

醉酒当歌 提交于 2020-01-25 08:24:04
问题 I am upgraded SpringBoot version 2.1.0 to 2.2.2.RELEASE java : openjdk11 spring-boot: v2.2.0.RELEASE springCloudVersion : Hoxton.RC1 Error : APPLICATION FAILED TO START Description: An attempt was made to call a method that does not exist. The attempt was made from the following location: springfox.documentation.spring.web.plugins.DocumentationPluginsManager.createContextBuilder(DocumentationPluginsManager.java:152) The following method did not exist: org.springframework.plugin.core