Newest swagger Questions

Q&A for professional and enthusiast programmers

How can I describe this JSON object in swagger parameters?

I've looked at a few other related questions and I still can't seem to find what I'm looking for. This is an example JSON payload being sent to an API I'm writing: { "publishType": "Permitable", ...

Autorest/Swagger generated code for Web Api controller that returns File

In my ASP.NET Web API application I have a controller like this: [RoutePrefix("api/ratings")] public class RateCostumerController : ApiController { [AllowAnonymous] [...

Generate Angular2 forms from Swagger API specification

I'm looking for a way to generate a set of Angular2 form templates from a Swagger API definition file. I want a result that will allow me to test my POST/PUT requests, and even use it in my app. ...

Defining 'N' Number of Dynamic Query Parameters in Swagger

I have the scenario where an endpoint can accept 'N' number of query parameters with a non-predetermined name and value i.e. I have no idea what query parameters someone might pass in e.g. ?i=can&...

swagger-codegen - How do I supply a body to the generated C# SDK method?

I'm using the (unofficial) swagger-codegen-cli Docker container from https://hub.docker.com/r/jimschubert/swagger-codegen-cli/ which pulls swagger-codegen from the master branch before it runs. I ...

Swagger Auto-generated Python Flask Server `ImportError: No module named 'swagger_server.models…'`

Using the online editor and a swagger YAML file, I generated a python flask rest server application. According to the README.md included in the generated server zip file, I executed pip3 install -r ...

Django Rest Swagger APIView

I made an API and want to make swagger doc. I don't develop any Serializes for that. Views.py class DeliveryView(APIView): renderer_classes = (XMLRenderer,) def get_campaign_vast(self, ...

Spring @GetMapping with @RequestParam and @RequestBody fails with HttpMessageNotReadableException

Request to the endpoint fails with the following error: 400 Bad request org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing @GetMapping public ...

Setting Custom Example Schema in Swashbuckle / swagger - Based on Action / Http Method

I am using "Swashbuckle.AspNetCore": "1.0.0-rc1"its woking great so far (thanks @domaindrivendev) I am providing schema examples for my models using an ISchemaFilter like so: public class ...

Generate documentation for custom implementation of Restful webservices

My project has a custom implementation of Rest for our API's (some 6k odd services) - We do not follow the JAX-RS specification. I am looking for a way to generate a Swagger (Yaml) document or WADL ...

Swagger - What must JSON syntax be to satisfy @ApiModelProperty of type Map<String, String> with Grails deployment

When I have an endpoint defined with one of the parameters like this: @ApiModelProperty(value = 'Some parameters', required = false) Map<String, String> someParams What must the JSON syntax be ...

Where should I put algorithms for common endpoints in a Swaggerize-Restify project?

I've scaffolded a Restify project using the excellent generator-swaggerize and would like to know where to put common algorithms for API endpoint methods? The algorithm maps database column names to ...

go-swagger annotation macro for dropdown parameter

What is the format for dropdown parameters in go-swagger? I have the following but I want it to show up in the swagger UI as a dropdown. What are the macros for that so the user can select one of the ...

Using swagger-codegen with username and password basic auth

I have a django rest_framework API, Swagger and a Swagger UI. When I am not logged in I can see a very limited view of "login" and "docs". When I am logged in I can see lots of stuff. I am trying to ...

What is causing the error that swagger is already in the route collection for Web API 2?

I installed Swagger in my ASP.Net MVC Core project and it is documenting my API beautifully. My co-worker asked me to install it in a full framework 4.6.1 project so I've done the following. In ...

Nested URL not showing in Django Rest Swagger

I'm trying to document my Django REST API using Django Rest Swagger. My main url conf looks like this: urlpatterns =[ url(r'^tickers/', include('tickerapi.urls')), ] and tickerapi/urls: ...

Exports is not defined

I have generated a javascript client from an API using Swagger. And this is my swagger specification: { "swaggerGenerator": { "webApiToSwagger": { "assemblyPaths": [ "AppBackend/...

Swagger and OAuth2 configuration flow

I'm working on Spring Boot application which is secured with OAuth2. I was asked to integrate swagger for documentation. And it was quite easy till the moment i need to configure authorization. https:/...

Swashbuckle doesn't render HTML Swagger documentation properly anymore

I've got Web service methods which return the same HTTP response for different reasons, such as a 400 Bad Request for different qualities of posted data. I use Swashbuckle to generate the Swagger API ...

Swagger path variable that includes rest of path

I am trying to create a swagger spec that encapsulates the remaining path as a variable. The spec path looks like /config/{path}. I would like the path variable to be any arbitrary path such as: path/...

Swagger: generate xml response with attributes

I need to provide swagger docs for an endpoint which produces xml instead of json. The problem is that xml attributes in the documentation's example are not generated properly. For instance: public ...

Swagger Body Parameters Returns 400 “Extra formData parameter(s) name not in spec”

Am having trouble sending body parameters via Python-2.7, connexion & Pycharm. api.yaml swagger: '2.0' info: title: Products Api Backend version: "1.0.0" consumes: - application/json ...

MySQL row properties in Swagger? (NOT NULL, UNIQUE, and AUTO_INCREMENT)

I'm trying to plan my API in Swagger. I'll be using a MySQL database, so the models include things like NOT NULL, UNIQUE, and AUTO_INCREMENT. How would I write a model like: CREATE TABLE employees ...

Swagger UI, while exploring working api-doc shows Uncaught TypeError: Cannot read property 'indexOf' of null and stuck forever fetching url

swagger-ui : Swagger api-docs shows "apiVersion":"1.0","swaggerVersion":"1.2" a swagger file reproducing the issue Api doc return response with json output while accessing following url http://...

.net Core web api/swashbuckle basepath and paths issue

My .net core web API project includes [Route("/api/v1/members")] attribute for the controller and [HttpGet("{id}")] for the method GetMemberById The resulting swagger description generated by ...

Django Rest Framework Swagger Documention for Nested Object?

I am trying to programatically add json input field in swagger using dango_rest_swagger but I am having trouble nesting object in array or another object. It only let me to one level of json. Here ...

Write swagger doc that consumes application/json AND application/x-www-form-urlencoded (w/o duplication)

I'm looking for an elegant way to define an api that can consume JSON data as well as form data. The following snippet works, but it's not elegant and requires all kind of ugly code in the backend. Is ...

Adding headers to only certain calls in Swashbuckle

I'm trying to set up Swagger for our API using Swashbuckle. Every one of our controllers inherits from a BaseController that has ~8 parameters(userId, language, platform, etc) on it. They each have ...

swagger api-docs get mixedup, when I try to hit one rest/api-docs it gives docs for all the rest calls

My swagger api-docs get mixed up though I access one rest api-docs, it shows api-docs for all the rest calls.

Where to add server logic using Swagger codegen with Lumen Server Stub

I have been looking around but haven't been able to find anything concrete on this so apologies if it has been asked before. I am using Swagger codegen to create a ServerStub for my Lumen API project ...

Suppress ConflictingBeanDefinitionException for @ComponentScan

I have a Spring project where multiple beans may have the same bean name. In order to avoid ConflictingBeanDefinitionException the project has an overridden ContextNamespaceHandler. public class ...

Swagger API with Flask - Development of API Starting Point [on hold]

I wish to learn how to Implement an API using Swagger after generating the Codes. I generated the Server side code in Flask and Client side code in Python using Swagger Codegen. Looking at the Server ...

Error when trying to make 2 database calls

Thanks in advance for tolerating with my noobishness in nodejs. I am making an api using swagger and node js using a postgres DB. I have loaded data into the db and am calling it from the api ...

how to use SWAGGER with RESTier? [on hold]

hi as you know swagger enable us to automatically generate documentation of methods, parameters and models of under develop REST web api but i have doubt that after add SwaggerGen to the services ...

Do I need a dedicated request object and a response object in Swagger?

An example is to create an student object. If I create one, the user doesn't have to enter a student id as it is generated at the back end. If I return a student with an id, it returns more than the ...

Is it possible to ignore a field of the definition with the specific path in Swagger?

I have a User definition like this: definitions: User: type : object description: The user account. properties: id: type : integer description: The ...

Swagger Implementation in Django

I have completed the setup of the swagger API, but the problem I am facing is, the parameter which I want to give to the API view are not coming in the Swagger UI. The image showing the Swagger UI

Swagger Format for PayPal Payment API

I'm new to OpenAPI and I need some help to create a basic swagger file for PayPal's payment API to create a payment from our platform. Note: OAuth is already configured. Below is a basic swagger file ...

Goswagger not creating appropriate json spec file

I am trying to create a spec file for the go implementation of petstore example . I tried a go generate in the directory which had doc.go but it did nothing. On further reading, I realised that there ...

Swagger-Nodejs documentation issue

How to document the nodejs API with express using swagger. I'm very new to swagger. var swaggerJSDoc = require('swagger-jsdoc'); var options = { swaggerDefinition: { info: { title: '...

How can I make Swagger read SpringMVC annotations

While reviewing a piece of code I encountered a heavily annotated function, which included something along the lines of @ApiParam(value = "order number", required = false) @RequestParam(value = "...

How to disable authentication requirement for apiDiscovery feature

Is there any way to disable the authentication requirement for accessing the API Documentation endpoints provided by the apiDiscovery-1.0 feature? I have the apiDiscovery-1.0 feature enabled on ...

Generate Swagger from JAX-RS endpoint with external enum definition

I want to generate a swagger from a JAX-RS endpoint with an external enumeration definition however the generated swagger directly includes the enumeration into the definition of the model. It implies ...

Swagger Nodejs - Response Validation Failed

I am building the API with Swagger and NodeJS, the annoying problem I have faced so far is Swagger validates the response, and it's not always smooth. My case: In file .yaml: I checked the yaml ...

Swagger editor doesn't offer relevant code completion

When I use swagger editor (online or local) sometimes it offers code completion of the relevant level and often it starts offering code completion of the root level: definitions, swagger, info, paths, ...

Changing Name and Description endpoint in Swagger-ui

I am using Spring boot and Spring Data Rest to implement my Rest API. To document it, I have been using Swagger, with these maven dependencies: <dependency> <groupId>io....

Swagger: wildcard path parameters

I have an API which allows any arbitrary path to be passed in, for example all of these: /api/tags /api/tags/foo /api/tags/foo/bar/baz Are valid paths. I tried to describe it as follows: /tags{...

Set base path in Camel Swagger Java Rest DSL

I am using camel-swagger-java to expose rest APIs. There is a way to set the base path when configuring a servlet in web.xml: <init-param> <!-- we specify the base.path using relative ...

Customize Springfox generation

I'm using springboot with springfox to generate swagger API. I have 2 issues with springfox : 1) It doesn't support inheritance 2) It doesn't support JsonAnyGetter (as I would) Could I override the ...

Camel swagger-ui disable on production

I am using this swagger in my project. I was wondering if anyone knows a way to disable and enable swagger in different environments?
Translating... 0%