Questions tagged [swagger-2.0]

Swagger is a specification and framework implementation for describing, producing, consuming, and visualizing RESTful web services. Swagger 2.0 is the current generation of the spec and includes many improvements over 1.X. This specification is now known as Open API 2.0.

Read more about Swagger 2.0 here.

Learn about how to migrate from 1.x to 2.0 here.

1666 questions
0
votes
0 answers

Unable to import swagger into aws api gateway

I'm using swagger 2.0 and it works fine with my server but I'm unable to import the same YAML/JSON file into AWS API GATEWAY. I get a number of errors when I upload the file . How should I use the Swagger with AWS API GATEWAY? I get the same errors…
jason
  • 3,932
  • 11
  • 52
  • 123
0
votes
0 answers

Swagger 2.0 File Upload type: file error

I want to upload image file. Swagger 2.0 code for upload /upload: post: summary: Uploads a file. consumes: - multipart/form-data produces: - application/json parameters: - name: image in: formData required:…
Asmita0915
  • 57
  • 1
  • 8
0
votes
1 answer

Schema Object “title” member using Springfox

I am using Springfox to write documentation for an Api and I am having some problems generating the documentation site using Dapperdox http://dapperdox.io because it requires that the optional schema object property “title” is present.…
Melissa Rojas
  • 78
  • 1
  • 10
0
votes
1 answer

Swagger editor is throwing error while specifying the response "Not a valid response definition"

I am trying to generate the API documentation using swagger editor. I specified my API specification as follow paths: /opendata/v1/{index}: get: tags: [verification] description: Verify the person information parameters: …
neha
  • 1,858
  • 5
  • 21
  • 35
0
votes
1 answer

How to exclude some (nested) properties from models used in @SWG\Response

I write API in Php Laravel and use swagger (2.0) annotations (lib: darkaonline/l5-swagger which use swagger-php) to generate swagger.json. I have following swagger: @SWG\Definition( definition="Space", @SWG\Property( property="id",…
Kamil Kiełczewski
  • 85,173
  • 29
  • 368
  • 345
0
votes
2 answers

Swashbuckle.AspNetCore only generating models with fields of type string

So I have a group model like this: public class GroupDTO { [Required] public Guid? Id { get; set; } [Required(AllowEmptyStrings = false)] [StringLength(maximumLength: 50)] public string Name { get; set; } } But the generated…
0
votes
1 answer

Generating swagger definition for legacy java applications without using annotations

Is it possible to generate swagger definition for legacy Java applications which do not follow REST based services? Note: I am able to generate swagger for applications with REST JAXRS and some other frameworks like spring. So the expectation is it…
0
votes
1 answer

@Swagger\Annotations\Example" doesn't exist error

I am using Swagger v.2 with PHP Annotations and right now I am facing a small issue with "Examples" in request body. In my controller it looks like this: /** * @SWG\Post( * tags={"pet"}, * path="/pet", * summary="Create a…
CannotCode
  • 125
  • 1
  • 2
  • 10
0
votes
1 answer

How to model this array using an OpenAPI description?

I want to write a API that would respond with an array. My OpenAPI description looks like this: definitions: DeviceArray: type: array items: type: string example: - {"DeviceID": 103609131103,"NetworkName":…
陈怀宇
  • 1
  • 2
0
votes
1 answer

Swagger with Title and Value

I’m using Swashbuckle to generate a Swagger for my .NET assembly. I have an enum with non-sequential and negative values. Like the following [JsonConverter(typeof(StringEnumConverter))] public enum ShiftDayOffRule { /// /// Shift…
Alex
  • 1,681
  • 2
  • 11
  • 18
0
votes
0 answers

Generate a method returning a non-nullable simple type (int instead of int?)

I'm using Swagger-Codegen v2.0 to automatically generate an SDK based on my API, which is defined using Swagger. My problem is: I have an operation which returns an integer, the generated method in the SDK returns a nullable integer. In the API…
Toto
  • 736
  • 9
  • 33
0
votes
0 answers

How to define explicit mapping for swagger-ui.html in spring boot application

I have an issue integrating swagger-ui (swagger2) into my spring-boot application. It seems as though the default location for swagger-ui being on the root is conflicting with an endpoint. For example, my base path is foobar (full url:…
Su_toL
  • 167
  • 2
  • 15
0
votes
1 answer

Can I make springfox be package-aware?

Let's say I have following classes .../RabbitController .../test/SomeController springfox, without any swagger annotations, works fine. rabbit-controller some-controller When I add another…
Jin Kwon
  • 20,295
  • 14
  • 115
  • 184
0
votes
1 answer

Multiple Swagger endpoints for API versioning

I am working with the following technologies: Java 7 Tomcat7 JAX-RS (Jersey 2) Swagger 2 Spring 4.3.3.RELEASE Where my backend hosts various types of versioned REST APIs. We have a v1 and v2 REST API context base path (/api/v1 and /api/v2). The…
rosenthal
  • 775
  • 1
  • 11
  • 28
0
votes
1 answer

How can I document a RestController of a Spring Boot webapp with Swagger?

I would like to add the following REST controller to an existing Spring Boot webapp and document it using Swagger: @RestController @Api(description="Querying concepts") public class KnowledgeModelController { private ConceptService…
Stefan Reisner
  • 607
  • 5
  • 12