swagger

com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector not found — while using Swagger

。_饼干妹妹 提交于 2019-12-07 09:16:25
问题 my first post on SO and expecting good stuff in return :-) I have developed a small java restful services app and integrated with Swagger. I have @Controller -> @Service -> @Repository architecture. I have deployed on Glassfish (4.1.1), when I use Chrome's 'Advanced Rest Client', I am able to perfectly send and receive rest calls (GET/POST etc), but when I use Swagger, it throws the following exception 'after Controller returns the correct response'. I have been struggling with this by

Can Swagger @APIOperation allow to specify a list of list in Java?

安稳与你 提交于 2019-12-07 08:40:51
问题 I have a method in a Java class with signature like below and I want to add Swagger Rest documentation for it. public List<List<MyCustomClass>> getMyCustomClasses(String id){ // } I want to know if there is a way to have either response or responseContainer to return List of List objects? Something like below? @ApiOperation(value = "find MyCustomClass objects by id", response =MyCustomClass.class , responseContainer = "List<List>") I have no issues in generating swagger docs if the response

How to mark a property as required in Swagger, without ASP.NET model validation?

爷,独闯天下 提交于 2019-12-07 08:02:24
问题 I am creating a public API that uses multiple private APIs (can not be accessed from outside). Business validations have been written for the private APIs and I do not want to re-write them for the public API. But I do want the swagger documentation to be the same. That is why I wonder if I can mark property as mandatory, without using the Required attribute of ASP.NET. But that the swagger documentation indicates that it is mandatory. Is this possible? 回答1: Yes, it's possible. Add your

AspNetCore Could not load type 'Swashbuckle.AspNetCore.SwaggerGen.SwaggerResponseAttribute'

核能气质少年 提交于 2019-12-07 07:48:04
问题 I have ASP.NET Core Web application where I am using swagger using the following: public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddSwaggerGen(c => { c.OperationFilter<ExamplesOperationFilter>(); c.OperationFilter<DescriptionOperationFilter>(); c.SwaggerDoc("v1", new Info { Version = "v1", Title = "API", Description = "", }); // Set the comments path for the Swagger JSON and UI. var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";

Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway

♀尐吖头ヾ 提交于 2019-12-07 07:14:54
问题 I already went Why does springfox-swagger2 UI tell me "Unable to infer base url." and Getting an unexpected result while configuring Swagger with Spring Boot and not using Spring Security at all and for each service, I am using @EnableSwagger2 annotations. I'm following tutorial from link: https://dzone.com/articles/quick-guide-to-microservices-with-spring-boot-20-e and using gateway-service for the project to run instead of proxy-service . gateway-service.yml server: port: 8060 eureka:

微服务 REST API 设计原则

此生再无相见时 提交于 2019-12-07 06:39:49
REST API 设计原则 REST API 的设计很有讲究,我司总结了一些规范和原则,详见 Cisco REST API 规范 ,编译如下: REST 方法 GET 方法的响应是由所请求URL代表的资源的表示 GET 方法不会改变请求URL所代表的资源 POST 请求在所请求的URL 路径下创建一个新的资源以作为叶子节点 POST 响应体或者为空(响应状态码为204), 或者是所创建的资源的表示(响应状态码为201) PUT 请求一个URL, 如果没有相应的资源存在, 就会创建一个相应的新资源 PUT 请求一个URL, 如果已经有相应的资源存在, 就会以请求体中的内容覆盖这个资源 PUT 响应体是所请求的URL代表的资源的表示, 包含了这个请求所作出的修改 DELETE 请求一个URL, 会删除相应的已存在的资源 DELETE 的响应体或者为空(响应码为204) , 或者是资源的表示(响应码为200) PATCH 请求一个URL, 是部分地修改相应的资源的状态, 参见 RFC6902 PATCH 响应返回所请求的URL代表的资源的表示, 包含了这个请求所作出的修改 URL 路径 URL 路径表示一个资源, 或一组资源的集合 URL 路径的开头形式一般为 /{service}/{apiclass}/v{version} 集合 URL 的最后一段是一个名词算数, 描述所包含资源的类型

Reactjs client for Swagger / OpenAPI API specification

强颜欢笑 提交于 2019-12-07 05:30:33
问题 Background Using Swagger Editor, I created a spec for my API. I see that Swagger also provide a "Generate a client" option in their Swagger Editor (probably using Swagger Codegen). Objective I want to generate a client and use it in my React app (created with create-react-app), and preferably enjoy some static typing capabilities (currently using flow). Currently None of the options in Swagger Editor there seem to work: javascript - provides a vanilla node module that you need to npm install

How to configure MultipleApiVersions in Swashbuckle using aspnet ApiVersioning

我的梦境 提交于 2019-12-07 03:46:18
问题 How do I configure swashbuckle to work with Aspnet API verisoning? https://github.com/Microsoft/aspnet-api-versioning In my Startup.cs I have the following code to initialize attribute based routing, api versioning, and swagger. var constraintResolver = new DefaultInlineConstraintResolver() { ConstraintMap = { ["apiVersion"] = typeof( ApiVersionRouteConstraint ) } }; config.MapHttpAttributeRoutes(constraintResolver); config.AddApiVersioning(); config.EnableSwagger(c => { c.MultipleApiVersions

Swagger default value for parameter

落爺英雄遲暮 提交于 2019-12-07 03:18:17
问题 How do I define default value for property in swagger generated from following API? public class SearchQuery { public string OrderBy { get; set; } [DefaultValue(OrderDirection.Descending)] public OrderDirection OrderDirection { get; set; } = OrderDirection.Descending; } public IActionResult SearchPendingCases(SearchQuery queryInput); Swashbuckle generates OrderDirection as required parameter. I would like to be it optional and indicate to client the default value (not sure if swagger supports

Non-required arguments in compojure-api/schema/swagger?

我与影子孤独终老i 提交于 2019-12-07 02:57:43
问题 When I have a definition of an API like this: (POST* "/register" [] :body-params [username :- String, password :- String, name :- String] (ok))) what's the appropriate way of making name optional? Is it: (POST* "/register" [] :body-params [username :- String, password :- String, {name :- String nil}] (ok))) 回答1: As you know it uses letk plumbing notation and as far as I recall the syntax is correct but the default value should be consistent with the expected type so I'd say it should be ""