All Projects → mohiva → Swagger Codegen Play Scala

mohiva / Swagger Codegen Play Scala

Licence: apache-2.0
Swagger client generator which is based on the PlayWS library

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to Swagger Codegen Play Scala

Bitcoin Core
A modern Bitcoin Core REST and RPC client.
Stars: ✭ 379 (+4111.11%)
Mutual labels:  rest, client
Swagger Core
Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
Stars: ✭ 6,898 (+76544.44%)
Mutual labels:  rest, swagger
Swagger Node
Swagger module for node.js
Stars: ✭ 3,917 (+43422.22%)
Mutual labels:  rest, swagger
Fakerest
Patch fetch/XMLHttpRequest to fake a REST API server in the browser, based on JSON data.
Stars: ✭ 350 (+3788.89%)
Mutual labels:  rest, client
Awesome Openapi3
😎 A list of awesome projects related to OpenAPI 3.0.x, curated by the community
Stars: ✭ 469 (+5111.11%)
Mutual labels:  swagger, client
Ring Swagger
Swagger Spec for Clojure Web Apps
Stars: ✭ 351 (+3800%)
Mutual labels:  rest, swagger
Purest
REST API Client Library
Stars: ✭ 448 (+4877.78%)
Mutual labels:  rest, client
Spring Petclinic Rest
REST version of the Spring Petclinic sample application
Stars: ✭ 257 (+2755.56%)
Mutual labels:  rest, swagger
Swagger Parser
Swagger Spec to Java POJOs
Stars: ✭ 468 (+5100%)
Mutual labels:  rest, swagger
Swagger Ui
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
Stars: ✭ 21,279 (+236333.33%)
Mutual labels:  rest, swagger
Pode
Pode is a Cross-Platform PowerShell web framework for creating REST APIs, Web Sites, and TCP/SMTP servers
Stars: ✭ 329 (+3555.56%)
Mutual labels:  rest, swagger
Swagger Stats
API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.
Stars: ✭ 559 (+6111.11%)
Mutual labels:  rest, swagger
Swagger Play
Stars: ✭ 320 (+3455.56%)
Mutual labels:  rest, swagger
Loopback Next
LoopBack makes it easy to build modern API applications that require complex integrations.
Stars: ✭ 3,972 (+44033.33%)
Mutual labels:  rest, swagger
Angularjs Springmvc Sample Boot
A RESTful sample using Spring Boot, Spring MVC, Spring Data and Angular/Bootstrap.
Stars: ✭ 309 (+3333.33%)
Mutual labels:  rest, swagger
Koa Rest Api Boilerplate
💯 Boilerplate for Node.js Koa RESTful API application with Docker, Swagger, Jest, CodeCov and CircleCI
Stars: ✭ 420 (+4566.67%)
Mutual labels:  rest, swagger
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+38211.11%)
Mutual labels:  rest, swagger
Httpie
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie
Stars: ✭ 53,052 (+589366.67%)
Mutual labels:  rest, client
Goa
Design-based APIs and microservices in Go
Stars: ✭ 4,493 (+49822.22%)
Mutual labels:  rest, swagger
Elasticsearch Js
Official Elasticsearch client library for Node.js
Stars: ✭ 4,828 (+53544.44%)
Mutual labels:  rest, client

Swagger Codegen - Play Scala Build Status Coverage Status Join the chat at https://gitter.im/mohiva/swagger-codegen-play-scala

A code generator for Swagger which generates API clients with the help of the PlayWS library. This code generator is based on the akka-scala generator included in the Swagger Codegen distribution.

Versions

Project Play
0.1.x 2.4
0.2.x 2.5
master 2.6

Create client

Download swagger codegen executable into the root directory of this project:

wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.0/swagger-codegen-cli-2.3.0.jar -O swagger-codegen-cli.jar

Execute the script

scripts/codegen.sh -i ${SWAGGER_SPEC_FILE} -o ${SWAGGER_CLIENT_DIR} -c ${SWAGGER_CONF_FILE}

To run the bundled petstore example:

scripts/codegen.sh -i conf/petstore.yaml -o build -c conf/config.json

Compile the client:

cd build
sbt compile

Config options:

The code generator supports the following config options:

Name Description
modelPackage The package for generated model classes
apiPackage The package for generated api classes
invokerPackage The package for generated root classes
configKeyPath Path under which the config must be defined
projectOrganization Project organization in generated build.sbt
projectName Project name in generated build.sbt
projectVersion Project version in generated build.sbt
scalaVersion The Scala version to use in generated build.sbt

How to use

To use the client you must inject a corresponding API handler into your controller or service. Every API handler itself has a dependency to the ApiInvoker which must be instantiated with the global configuration and an instance of the WSClient. It's the best to wire this dependencies with your preferred DI method.

Every method created for you API handler accepts, additional to the parameters created from the Swagger spec, an optional request config which can be used to override the global config.

Global config

Property Description
url The optional API URL. If this URL is defined then it has precedence over the URL defined in the Swagger spec.
requestTimeout The request timeout. Defaults to 20 seconds.

Request config

Property Description
url The optional API URL. If this URL is defined then it has precedence over the URL defined in the Swagger spec and the global config.
timeout The request timeout. Defaults to None, which means the global config has precedence.

WS Client config

The underlying WSClient can also be configured in your Play configuration.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].