Swagger – Specify Optional Object Property or Multiple Responses

You’re getting the error in the model, because that’s not the way to define required properties. The correct form would be: “my_response_object”: { “type”: “object”, “required”: [ “result” ], “properties”: { “result”: { “type”: “string”, “description”: “value of ‘success’ or ‘error’, indicated whether was successful” }, “message”: { “type”: “string”, “description”: “an error message if … Read more

openapi tools generator vs swagger codegen

From the OpenAPI Generator FAQs What is the difference between Swagger Codegen and OpenAPI Generator? Swagger Codegen is driven by SmartBear while OpenAPI Generator is driven by the community. More than 40 top contributors and template creators of Swagger Codegen have joined OpenAPI Generator as the founding team members. For more details, see the Fork … Read more

Convert Swagger JSON to RAML/YAML

Here are the steps: Export Swagger JSON into a file on your drive. This JSON should be published on your server at the following URI: /swagger/docs/v1 Go to http://editor.swagger.io/#/ On the top left corner, select File-> Import File… Point to the local Swagger JSON file you exported in step #1 to open in the Swagger … Read more

Swagger documentation for Spring Pageable interface

This is a known issue with Spring-Fox. See Issue #755. Based on zdila’s comment 2 at this time alternative is to add @ApiImplicitParams which is not ideal but it does work. @ApiImplicitParams({ @ApiImplicitParam(name = “page”, dataType = “integer”, paramType = “query”, value = “Results page you want to retrieve (0..N)”), @ApiImplicitParam(name = “size”, dataType = … Read more

What is the benefit of using Spring REST Docs comparing to Swagger

I just saw a presentation here that touches on your question among other topics: Swagger doesn’t support hypermedia at all / it’s URI centric Swagger’s method of inspecting your code can lag behind your code. It’s possible make a change in your code that Swagger fails to understand and won’t process properly until Swagger gets … Read more

Is there a way change the Controller’s name in the swagger-ui page?

Starting with ASP.NET Core 6, you can use the TagsAttribute either on Controller level: [Tags(“entity”)] [ApiController] public class DerivedEntitiesController : ControllerBase { or on Action level: [Tags(“entity”)] [HttpPut(“entity/{key}”)] public IActionResult PutEntity(Guid key, [FromBody] Entity entity) { Swagger will group according to the Tags and respect API Versioning.

How to define mutually exclusive query parameters in Swagger (OpenAPI)?

Mutually exclusive parameters are possible (sort of) in OpenAPI 3.x: Define the mutually exclusive parameters as object properties, and use oneOf or maxProperties to limit the object to just 1 property. Use the parameter serialization method style: form and explode: true, so that the object is serialized as ?propName=value. An example using the minProperties and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)