swagger-2.0

Apache CXF Jax-rs server generated from API spec using Swagger 2.0, what do I need to add to get this working?

穿精又带淫゛_ 提交于 2019-12-11 01:25:01
问题 I have generated Apache CXF JAX-RS REST api server side code using Swagger 2.0 specification thus created with CXF version 3.1.8 dependencies. I want to understand what is the next step in order to get a REST application server running(standalone Jetty or Spring Boot or Tomcat). I am specifically looking for maven dependencies involved + configurations I need to add. I found it difficult to gather the correct details from available documentation as is it brief. I tried following the CXF

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 UI - can't enable JSON editor for the request body

强颜欢笑 提交于 2019-12-10 19:44:05
问题 I have some issue to make it work, according to following link below, the JSON editor for the request body (disabled by default). https://github.com/jensoleg/swagger-ui How can I enable it? 回答1: I found the solution. Add the following into index.html in the new SwaggerUi({}) constructor: docExpansion: "none", sorter: "alpha", jsonEditor: true, defaultModelRendering: 'schema', showRequestHeaders: true 来源: https://stackoverflow.com/questions/37441859/swagger-ui-cant-enable-json-editor-for-the

How to set request interceptor in SwaggerUIBundle?

家住魔仙堡 提交于 2019-12-10 17:56:54
问题 In our swagger.json we are setting basePath to /api , however, when the application is deployed in docker container, the context path is not /api. This could be different thing and we don't know what it is so we can't hard code it. I am trying to set requestInterceptor as per the following guide, in order to catch the request and modify the url path perhaps: https://swagger.io/docs/swagger-tools/#customization-36 But it seems requestInterceptor is being ignored. Is this possible? If not, how

How to receive a dynamic response in a Swagger spec

我们两清 提交于 2019-12-10 17:34:21
问题 I want to request a table from my database through my API. However, I don't know what number of columns the table will have, or what it will contain. How can I specify this in Swagger? This is what I would like to do: paths: /reports/{id}: get: summary: Detailed results description: filler parameters: - name: id in: path description: filler required: true type: integer format: int64 responses: 200: description: OK schema: type: array items: $ref: '#/definitions/DynamicObject' definitions:

Getting error while loading swagger-ui.html in spring(5.0.0.RELEASE) mvc

让人想犯罪 __ 提交于 2019-12-10 16:18:47
问题 Could not resolve reference because of: Could not resolve pointer: /definitions/Error does not exist in document I followed this link http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api , but getting above error while I add globalResponseMessage() methhod for custom response message.I can't understand what's the reason. Please help....TIA @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.any()) .paths

How to define array-of-objects as parameter?

懵懂的女人 提交于 2019-12-10 15:22:16
问题 I am quite new to Swagger , so this might be a basic question. I am able to create .yml file for an API which takes an array of integers as parameter, as follows: Add samples --- tags: - MY API parameters: - name: my_id in: path type: integer required: true description: Some des - name: body in: body schema: id: add_samples required: - sample_ids properties: sample_ids: type: array items: type: integer description: A list of sample ids to be added responses: '200': description: Added samples.

Render html in springfox-swagger-ui

筅森魡賤 提交于 2019-12-10 13:55:55
问题 I recently updated an application running springfox-swagger2 and springfox-swagger-ui 2.5.0 to use version 2.6.0. The application's API documentation uses <li> , <b> and <br> tags, which were rendered correctly with 2.5.0, but with version 2.6.0 the <li> and <br> tags are ignored by the swagger-ui. What do I have to do to make springfox render the HTML tags again? The tags are used at the following positions: ApiInfoBuilder().description("HERE") @ApiOperation(notes="HERE") @ApiResponse

Swagger / Open API 2.0 can I declare a common response header?

杀马特。学长 韩版系。学妹 提交于 2019-12-10 04:26:41
问题 Is it possible to declare a custom response header which would be present in all responses without copying it in each of the response structure? 回答1: According to section 2.3 Response’s headers of Writing OpenAPI (Swagger) Specification Tutorial – Part 5 – Advanced Input And Output Modeling the answer is no. Which is what I understand from the 2.0 spec too. Vote/comment on Structural improvements: enhance headers handling · Issue #690 · OAI/OpenAPI-Specification. 回答2: This was somewhat

Spring boot & Swagger 2 UI & custom requestmappinghandlermapping - mapping issue

余生颓废 提交于 2019-12-09 21:20:06
问题 I have own RequestMappingHandlerMapping and I am using springfox-swagger-ui. After adding my custom mapping, I am not able to achieve swagger ui at http://localhost:8080/swagger-ui.html. Any ideas? This is my configuration. @Configuration public class WebMvcConfig extends WebMvcConfigurationSupport { @Override @Bean public RequestMappingHandlerMapping requestMappingHandlerMapping() { return new ApiVersionRequestMappingHandlerMapping("v"); } @Override public void addResourceHandlers