Questions tagged [swagger-play2]

This is a module to support the play2 framework from playframework. It is written in scala but can be used with either java or scala-based play2 applications.

This is a module to support the play2 framework from playframework. It is written in scala but can be used with either java or scala-based play2 applications.

Play is based on a lightweight, stateless, web-friendly architecture.

Built on Akka, Play provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.

14 questions
15
votes
4 answers

Optional params with Play 2 and Swagger

I'm trying to use Swagger to document a Play 2 REST API but swagger-play2 doesn't seem to understand optional parameters defined with Scala's Option type - the normal way to make a param optional in Play 2: GET /documents…
Tom Wadley
  • 121,983
  • 1
  • 26
  • 29
6
votes
3 answers

Configuring Swagger with Play/Java-framework-2.5

I am trying to configure Swagger with my Play-2.5 project. I followed this tutorial and it worked, but only for the older version of Play and not working with Play-2.5. As the project has migrated into Play-2.5, we had to remove the swagger…
6
votes
1 answer

How to control the way Swagger generates the model/schema for a type

I was able to setup Swagger with Play and try Swagger-ui... and I must say it's really great. Documenting the actions of my controller with ApiOperation, ApiImplicitPara, etc. was easy and it works as expected. Nevertheless, due to my limited…
j3d
  • 9,492
  • 22
  • 88
  • 172
5
votes
3 answers

Swagger Data Type Model in ImplicitParam with Play Framework

I'm trying to use Swagger to document my REST API. Following this example, I annotate the REST Endpoints like this: case class CreateItemRequest(title: String, body: String) @ApiOperation(value = "Create a new item", httpMethod = "POST", response =…
daniel m
  • 415
  • 6
  • 15
4
votes
0 answers

Swagger with play 2

did anyone tried using swagger with play 2. i have play 2 java project and i am trying to integrate swagger with it without any luck. i installed the package using this dependency: "com.wordnik" %% "swagger-play2" % "1.3.7" but i keep getting this…
user3687679
  • 359
  • 2
  • 16
2
votes
0 answers

Swagger-play2 - hiding internal parameters

I have configured swagger-play2 library version 1.7.1 (for play framework version 2.7) and have it up and running successfully. Our controller methods have an additional input: Http.Request request which is passed across the application for some…
popcoder
  • 2,952
  • 6
  • 32
  • 47
2
votes
1 answer

How can I easily serve the Swagger UI in the root of my Scala Play2 microservice?

I'm developing a microservice with Scala and Play 2.5 and trying to document my endpoints with Swagger. I added the Swagger UI webjar to my dependencies: "org.webjars" % "swagger-ui" % "2.1.8-M1" And the Swagger Play2 plugin: "io.swagger" %%…
Gabriel C
  • 1,012
  • 3
  • 12
  • 30
1
vote
1 answer

Swagger integration with Java Play framework

My objective is to integrate Swagger with my java play Framework Project. After referring the enter link description here swagger-play Website: https://github.com/swagger-api/swagger-play Short description: Generate a Swagger API spec from your…
ancylijo
  • 31
  • 3
1
vote
2 answers

Configure Swagger api with Play 2.4

Facing problem while configuring swagger api with play 2.4 framework. Follow this url for configuration : https://github.com/swagger-api/swagger-play/tree/master/play-2.4/swagger-play2 After configuration gets a compile time error with message "type…
front_end_dev
  • 1,998
  • 1
  • 9
  • 14
0
votes
1 answer

Swagger-play2: How to allow array of objects as input in swagger ui using @ApiImplicitParams annotation?

I am trying to write swagger API for a method which takes an array of case class objects. I have done something as follows: package models import io.swagger.annotations.{ApiModel, ApiModelProperty} import play.api.data.Form import…
0
votes
1 answer

Swagger integration with Play2

I've followed https://github.com/swagger-api/swagger-play/blob/master/play-2.7/swagger-play2/README.md and integrated swagger-play2 version 1.7.1 with my play 2.7 app. When accessing /swagger.json endpoint, I'm getting the following error thrown…
popcoder
  • 2,952
  • 6
  • 32
  • 47
0
votes
1 answer

Why I get readystate undefined and status 0 if I call same rest Api multiple times on openshift origin?

I get the readystate undefined and status 0 as response when I call the same API multiple times and call it quickly one after another. I have buttons on my webpage for calling api and if I give gap in clicking e.g. 3 seconds, the api works fine. I…
0
votes
1 answer

Swagger UI - not able to expand operations

I am trying to use swagger with play framework. I have added the API annotations in the code and i can access it via localhost:9000/api-docs { apiVersion: "beta", swaggerVersion: "1.2", basePath: "http://localhost", resourcePath:…
0
votes
1 answer

Serialize and deserialize Play2 Html object

I have a Document case class. To Serialize it and deserialize to and from Json text, I defined implicit Reads and Writes object. If my Document class contains only Int and String, I have no problem. However when I have an Html type value in my…
Ervinn
  • 1
  • 2