swagger

How to mark api parameter as optional for Swagger UI for Web API 2?

℡╲_俬逩灬. 提交于 2021-01-29 03:30:29
问题 I am using Swagger for WebApi 5.5.3 nuget package for API documentation. In swagger UI it is showing required option for optional parameter. I tried XML comment option in Visual studio. Below is the API method that i want to document: /// <summary> /// Gets the history. /// </summary> /// <param name="currentPageIndex">Index of the current page.</param> /// <param name="pageSize">Size of the page.</param> /// <param name="lastSyncDate">The last synchronize date.</param> /// <returns></returns

Unable to access swagger despite cors enabled Asp.NET WebAPI

隐身守侯 提交于 2021-01-29 02:48:28
问题 I have a WebAPI - .NET framework 4.6.2 I am getting below error on the accessing the webapi via swagger: Can't read from server. It may not have the appropriate access-control-origin settings. I have already CORS in my code I wonder what is going worng WebAPIConfig.cs public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.EnableCors(); } } GlobalAsax.cs protected void Application_Start() { RouteTable.Routes.MapOwinPath("swagger", app => { app

I am getting 404 for https://localhost:8080/swagger-ui.html

天大地大妈咪最大 提交于 2021-01-28 20:22:52
问题 I am getting a valid response for http://localhost:8080/v2/api-docs/ but while I am trying to access, I am getting http://localhost:8080/swagger-ui.html. Here I have attached pom.xml <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-rest</artifactId> </dependency> <dependency> <groupId>org.springframework.boot<

springboot security swagger springfox-boot-starter

醉酒当歌 提交于 2021-01-28 14:20:08
问题 pom.xml <!-- swagger --> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> <version>3.0.0</version> </dependency> spring-security configure protected void configure(HttpSecurity httpSecurity) throws Exception { String[] SWAGGERS = { "/swagger/**", "/v3/**" }; httpSecurity .authorizeRequests(expressionInterceptUrlRegistry -> expressionInterceptUrlRegistry // 放行 druid 页面 .antMatchers("/zhy-druid/**").permitAll() .antMatchers(SWAGGERS).anonymous()

Adding Swagger to Dropwizard application, need to provide instance of SwaggerBundleConfiguration?

僤鯓⒐⒋嵵緔 提交于 2021-01-28 12:29:31
问题 I'm super new to all of these frameworks so please try and bear with me here with what feels like should be a super simple thing. I'm trying to learn the process of integrating Swagger into an existing Dropwizard application to generate the API documentation, ideally using the Swagger UI interface so that it's interactive for people trying to use/learn it. Specifically, using this bundle: smoketurner/dropwizard-swagger Before trying to wrestle with the full sized project my employer wants it

Adding Swagger to Dropwizard application, need to provide instance of SwaggerBundleConfiguration?

余生颓废 提交于 2021-01-28 12:19:46
问题 I'm super new to all of these frameworks so please try and bear with me here with what feels like should be a super simple thing. I'm trying to learn the process of integrating Swagger into an existing Dropwizard application to generate the API documentation, ideally using the Swagger UI interface so that it's interactive for people trying to use/learn it. Specifically, using this bundle: smoketurner/dropwizard-swagger Before trying to wrestle with the full sized project my employer wants it

Weird “Could not resolve reference: undefined Not Found” messages in Swagger UI 3

こ雲淡風輕ζ 提交于 2021-01-28 11:54:53
问题 While migrating Alfresco's REST API Explorer from Swagger UI 2 to Swagger UI 3 (3.38.0), a single API definition raised two Could not resolve reference: undefined Not Found errors at : paths./search.post.parameters.0.schema.properties.pivots.items.properties.pivots.items.$ref and paths./search.post.responses.200.schema.properties.list.properties.context.properties.request.properties.pivots.items.properties.pivots.items.$ref All the API definitions were working fine in Swagger UI 2 All the API

swagger add document and operation for a generic controller

断了今生、忘了曾经 提交于 2021-01-28 09:22:42
问题 i am working on a webapi with plugins. I want to update the swagger documentation when a plugin is added. I can handle this when i don't use version. All methods are added to the swagger documentation. but when the api has apiversion turned on, the generation of the new version swagger document failed. It returns a 404. do i need to so anything for versioning to work and pick up the dynamic controller functions... private string AddSwaggerVersionDocument(PluginMetadata metadata) { var version

Swagger sort Schema Definitions

流过昼夜 提交于 2021-01-28 07:25:49
问题 It is not possible to create subgroups in the Swagger documentation. Further, there is no possibility to sort the models (A, B). For the operations, it is possible to work around it using tags. Is there a similar solution for the Data Definitions? (We are using Swashbuckle to create an HTML description.) 来源: https://stackoverflow.com/questions/57057487/swagger-sort-schema-definitions

Swagger sort Schema Definitions

牧云@^-^@ 提交于 2021-01-28 06:51:14
问题 It is not possible to create subgroups in the Swagger documentation. Further, there is no possibility to sort the models (A, B). For the operations, it is possible to work around it using tags. Is there a similar solution for the Data Definitions? (We are using Swashbuckle to create an HTML description.) 来源: https://stackoverflow.com/questions/57057487/swagger-sort-schema-definitions