Newest swagger Questions

Q&A for professional and enthusiast programmers

Swagger Error A deterministic version of a JSON Schema object

This is the Schema definition. serviceArea: [{ states: [{ type: String }], districts: [{ type: String }], cities: [{ type: String }] }] This is the ...

NSwagStudio generating broken client code (duplicate enum values). What am I doing wrong?

I'm trying to generate a c# client from an AspNetCore Web API using NSwagStudio. The generated code contains a set of enums that, based on the attributes decorating them, are apparently flags for Json ...

How to describe input model as much as possible using Swagger

I have an example input model as follows: public class CarInputModel { public string Name { get; set; } public string ModelName { get; set; } } This values will come from UI, what kind of ...

how to migrate swagger document 1.2 to 2.0?

What is the easiest way to make swagger version 2.0 documents using existing node.js APIs? Currently I am using node-swagger-express npm. The generates swagger documents's version is 1.2. Except ...

swagger API : How to include in our application

I have an application in which on clicking on one link, i have to display swagger generated page. Using swagger editor online on giving yaml as input , it generates REST call s list . I want show ...

What's app-root in this project?

I'm going on to start a Spring boot Restful project using this article to build a restful application and then this link to add swagger2 to it. in second link it says somewhere that you can test ...

Using XmlComment for swagger api helper page

I got error when try to config swagger for my new start ASP.NET Core api project. It work perfectly on local host : the comment work good with xml comment. But when I publish it to azure host, it ...

Loopback Swagger HTML doesn't show Parameters for the Endpoints

In a NodeJS based project, the Swagger that comes with loopback-component-explorer (version 2.7.0) doesn't show the "Parameters" in the HTML page in which we can provide the required params for the ...

How can I make Swashbuckle respect DataType when generating swagger files?

I am working with a more complex version of the following data contract, but this should be sufficient as an example: using System; using System.Runtime.Serialization; using System.ComponentModel; ...

Swagger: How to get formatted example json

I'm really struggling to understand the format of the examples section of a response. I have the following response defined for a 500 Internal Sever error. 500InternalServerError: description: ...

Swagger Not Showing the Apis

I have added swaschbuckle swagger to my api project but it is not showing me the apis list

Best way how to describe “ModelAttribute” with Swagger

I am trying to integrate Swagger2 to my Spring Boot based application. The issue is that swagger does not consider model attributes. @GetMapping(value = "/events", produces = MediaType....

ClassNotFound Maven War

I'm building a multi-module Maven web app project, but I'm having trouble deploying the WAR on my Tomcat server. My project structure is MyApp MyAppSchemas MyAppUtils MyAppWs Here's the problem....

Code Block in Description in Swagger UI

I would like to put a Markdown code block in the description of my API but the Swagger UI seems to be reading as though it was a single line code snippet. I currently have: description: | This ...

Swagger Pattern not working with Swagger UI

I am making an API with swagger and am trying to update the YAML to add regex pattern requirements to the parameters. Currently I am trying the following: # getCPIStatesForCountry endpoint /...

What is Swagger, Swashbuckle and Swashbuckle UI

This is my understanding: Swagger is a notation/rules to write documentation. But why is it called a framework(Like angular/MVC)? Swashbuckle is a program(javascript ?) that generates the ...

Extend Android App with auto generated swagger interface

Following scenario: I've got an existing Android Studio Project (some simple app). Now I want to extend this app with a RESTful Web Service Client. Therefore I'd like to use retrofit 2, or volley. I'd ...

Swagger - Get Model to validate my API with 'assertJsonStructure'

I wrote an API documentation (JSON\YAML) using Swagger and now I'd like to get the Model example for each RESTful and use It to validate my API output using PHPUnit test. Is there a way to do that? ...

How to work with Visual Studio 2017 generated restful api from swagger docs

So I am working with Visual Studio 2017 Enterprise, and I noticed the other day that you can right click and do file add restful api client. So I went out and generated the .json file for my restful ...

Include default responses to swagger documentation

I am building an application using swagger in python. I specified all outcomes produces by my code in the swagger yaml file. Connexion, the library which I am using, also checks for validity of the ...

Generate nodejs from Swagger spec

So I've documented my whole API with swagger editor, and now I have my .yaml file. I'm really confused how I take that and generate the whole nodejs stuff now so that all those functions are already ...

Swagger, line break s

How do you get line breaks in Swagger documentation, in the description? I'm working in Visual Studio, (i.e. not Visual Studio Code with ASP .Net Core). Thanks, Regards

SpringFox Swagger and LocalTime

Anybody knows how to format LocalTime in Springfox? Converting to ISO format works for LocalDate with this setting to ObjectMapper .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) ...

How to resolve Swagger error “instance type (string) does not match any allowed primitive type…”

Background I've just started a new project and would like to use Swagger for my API Documentation. I am currently running my project locally, hosted in IIS. I have modified my hosts file to give ...

Swagger UI example data

Is there a way in swagger to show example data for; model, both input & output, query parameters, headers, etc? I have been unable to find anything related to this in the annotations documentation;...

Documenting message based API in Swagger or RAML

How do we document a message based API in Swagger or RAML ? By message based I mean that the endpoint is always the same, but one can send multiple message types to this endpoint and depending on the ...

Is there a swagger-ui like framework for javascript functions?

Swagger UI seem really useful to document HTTP APIs. Is there a similar tool for documenting javascript apis? for example, I need to show a javascript function name, parameters. theres a button ...

Get 404 When Deploy WAR on Tomcat

So I'm new to Tomcat, and I can't figure out why I keep getting 404 errors when I try to access my WAR file on my local Tomcat 7 server. I've looked at several other posts on SO and elsewhere, but ...

Swagger UI response model display

If I annotate like @ApiOperation( value = "Add a tag to a task", responseContainer = "List", httpMethod = "POST" ) @ApiImplicitParams( { @ApiImplicitParam( name = RestRequestHeader....

Why getting error 500 in AspNetCore API documentation using [FromQuery] attribute?

I am facing a problem to generate APi documentation using Swashbuckle.AspNetCore. When ever I write a method with [FromQuery] attribute always getting error 500 Please check the bellow code ...

Swagger ignores xml parameter tag

i am using Swagger + xml comment file for my Asp.net webapi documentation. The value in the summary tag is displayed, but the param tag gets ignored. I have an OdataController v4 // GET: api/...

Swagger doesn't display information about methods - SpringBoot

I have an API in Java SpringBoot and I want to document it in Swagger. I have done the following (I only include classes that contain some code related to Swagger): Main class @EnableSwagger2 ...

Generated html of swagger file does not show example

The generated html and html2 pages of my swagger file doesn't show the examples. But I can see them on Swagger Editor output panel. Here is an example of what I am doing: /getMyObject post: .....

Unable to communicate with web Service using swagger

I have a Webservice and I would like to communicate with this web Service via Swagger API in C#. I have converted my Swager.json to c# client libraries to use them in c#. My Webservice consists a ...

Is it possible to have NSwag ignore a controller?

I used NSwag to generate a client for a single controller; I needed it as its own separate client. I would like for it to be ignored when the Swagger specification is generated in the future. I ...

Creating dummy service to test its Java implementation in Swagger

In my recent project I received specification of service in YAML file. After using Swagger codegen I got my implementation in Java JAR file. However, when I call a service from program all that I got ...

Why does swagger-codegen generate code that returns status 200 when there are validation errors

I used swagger-codegen to build a service api in javascript. When the call works it returns my custom defined type and status 200, but when there is a validation error it returns an error but also a ...

Grouping of API's in swagger UI

If there are different groups of API's in swagger UI, I will get all group names in a dropdown menu. How to make one of the groups to list their API's by default?

Describing Dynamic Response Types For REST API

I use a standard APIResponse Object Interface for all of my REST APIs. public interface IAPIResponse { IAPIError Error { get; set; } IEnumerable<dynamic> Results { get; set; } ...

How to integrate django-rest-swagger 2.0 with existing DRF application(Beginner)

I am trying to integrate swagger 2.0 with existing DRF application but it gives following error in browser after runningpython manage.py runserver: TemplateDoesNotExist at /swagger ...

Swagger avoid removing common prefix

How to skip removing the common prefix from modelsEnum name? I have got an enum with single value (in the future I will have more values) and swagger code gen plugin generates the class with enum CODE ...

Is there any directory convention for placing of Swagger definitions and for the generated code?

I'm having a Java project built by Gradle. I'm wondering if there is some already established convention of "default" directory structure for placing Swagger definitions and possibly the location of ...

How to display required user roles (access control information) in Swagger UI for Spring's endpoints?

I have a rest api made in Spring and am using Swagger for documentation. Recently a token based authentication was implemented. In the token, there are (internal) user's roles (authorities). Each ...

Can't acces swagger server into docker container

I have a swagger server api in python that I can run on my pc and easily access to the user interface via web. I'm now trying to run this API into a docker container and place it into a remote server. ...

Ignore specific properties conditionally DTO

I have a specific requirement, I have a single POJO like EmployeeDTO.java with below Fields; int employeeId; String Name; double salary; String createdBy; Date createdTimestamp; String updatedBy; ...

Path parameters optional in Swagger annotation

I'm using this library. I want to have an optional parameters in my url for instance I have this route $app->get('/files/{order:\d+}[/{all:0|1|all}]', 'myctroller'); And my annotation is /** *...

Swagger UI - Custom html page does not show API list

I added custom index.html & downloaded the code for index.html from following location (https://github.com/domaindrivendev/Swashbuckle#injecting-custom-content) & changed the URL in the new ...

Swagger parameter error “is not exactly one from <#/definitions/parameter>”?

I'm trying to write a simple Swagger / Open API definition using the Swagger Editor. swagger: "2.0" info: version: 1.0.0 title: Test API description: Test API schemes: - https host: hipaa....

Django rest swagger, How to do POST api's?

I'm using django-rest-swagger(2.1.2), and used the basic scheme in the examples. from rest_framework_swagger.views import get_swagger_view schema_view = get_swagger_view(title='My great API', url='/...

How to create Swagger doc from multiple swagger files

I defined APIs through swagger. For each micro-service, I have a swagger file say micro-service1.yaml.Like that I have around 40 micro-services. Accessing each one is difficult . I want to access all ...
Translating... 0%