forked from loafle/openapi-generator-original
Merge remote-tracking branch 'upstream/master'
merge fork with master
This commit is contained in:
commit
fb3f331e3c
40
README.md
40
README.md
@ -1,8 +1,6 @@
|
||||
# Note! The swagger-codegen will be moving from the wordnik organization to swagger-api!
|
||||
|
||||
# Swagger Code Generator
|
||||
|
||||
[](https://travis-ci.org/wordnik/swagger-codegen)
|
||||
[](https://travis-ci.org/swagger-api/swagger-codegen)
|
||||
|
||||
## Overview
|
||||
This is the swagger codegen project, which allows generation of client libraries automatically from a
|
||||
@ -13,7 +11,7 @@ Swagger-compliant server.
|
||||
The goal of Swagger™ is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined via Swagger, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, Swagger removes the guesswork in calling the service.
|
||||
|
||||
|
||||
Check out [Swagger-Spec](https://github.com/wordnik/swagger-spec) for additional information about the Swagger project, including additional libraries with support for other languages and more.
|
||||
Check out [Swagger-Spec](https://github.com/swagger-api/swagger-spec) for additional information about the Swagger project, including additional libraries with support for other languages and more.
|
||||
|
||||
|
||||
## Compatability
|
||||
@ -21,9 +19,9 @@ The Swagger Specification has undergone 3 revisions since initial creation in 20
|
||||
|
||||
Swagger Codegen Version | Release Date | Swagger Spec compatability | Notes
|
||||
----------------------- | ------------ | -------------------------- | -----
|
||||
2.1.0 (in development) | n/a | 2.0 | [branch develop_2.0](https://github.com/wordnik/swagger-codegen/tree/develop_2.0)
|
||||
2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/wordnik/swagger-codegen/tree/v2.0.17)
|
||||
1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/wordnik/swagger-codegen/tree/swagger-codegen_2.9.1-1.1)
|
||||
2.1.0 (in development) | n/a | 2.0 | [branch develop_2.0](https://github.com/swagger-api/swagger-codegen/tree/develop_2.0)
|
||||
2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17)
|
||||
1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1)
|
||||
|
||||
|
||||
### Prerequisites
|
||||
@ -35,7 +33,7 @@ Note! Some folks have had issues with OOM errors with java version "1.6.0_51".
|
||||
|
||||
* [Apache maven 3.0.3 or greater](http://maven.apache.org/)
|
||||
|
||||
* [Scala 2.9.1](http://www.scala-lang.org)
|
||||
* [Scala 2.10.4](http://www.scala-lang.org)
|
||||
|
||||
* [sbt (only download if you're building on Windows)](http://www.scala-sbt.org/)
|
||||
|
||||
@ -61,7 +59,7 @@ You can build a client against Wordnik's [petstore](http://petstore.swagger.word
|
||||
./bin/scala-petstore.sh
|
||||
```
|
||||
|
||||
This will run the script in [samples/client/petstore/ScalaPetstoreCodegen.scala](https://github.com/wordnik/swagger-codegen/blob/master/samples/client/petstore/scala/ScalaPetstoreCodegen.scala) and create the client. You can then
|
||||
This will run the script in [samples/client/petstore/ScalaPetstoreCodegen.scala](https://github.com/swagger-api/swagger-codegen/blob/master/samples/client/petstore/scala/ScalaPetstoreCodegen.scala) and create the client. You can then
|
||||
compile and run the client, as well as unit tests against it:
|
||||
|
||||
```
|
||||
@ -90,7 +88,7 @@ It's just as easy--you can either run the default generators:
|
||||
Replace `Scala` with `Flash`, `Java`, `Objc`, `PHP`, `Python`, `Python3`, `Ruby`.
|
||||
|
||||
You will probably want to override some of the defaults--like packages, etc. For doing this, just create a scala
|
||||
script with the overrides you want. Follow [ScalaPetstoreCodegen](https://github.com/wordnik/swagger-codegen/blob/master/samples/client/petstore/scala/ScalaPetstoreCodegen.scala) as an example:
|
||||
script with the overrides you want. Follow [ScalaPetstoreCodegen](https://github.com/swagger-api/swagger-codegen/blob/master/samples/client/petstore/scala/ScalaPetstoreCodegen.scala) as an example:
|
||||
|
||||
For example, create `src/main/scala/MyCodegen.scala` with these contents:
|
||||
|
||||
@ -140,7 +138,7 @@ You can look at `src/main/resources/${your-language}` for examples. To make you
|
||||
and override the `templateDir` in your script to point to the right place. It actually is that easy.
|
||||
|
||||
### Where is Javascript???
|
||||
See our [javascript library](http://github.com/wordnik/swagger.js)--it's completely dynamic and doesn't require
|
||||
See our [javascript library](http://github.com/swagger-api/swagger-js)--it's completely dynamic and doesn't require
|
||||
static code generation.
|
||||
There is a third-party component called [swagger-js-codegen](https://github.com/wcandillon/swagger-js-codegen) that can generate angularjs or nodejs source code from a swagger specification.
|
||||
|
||||
@ -163,7 +161,7 @@ ci server... or while coding on an airplane.
|
||||
|
||||
### Validating your swagger spec
|
||||
You can use the validation tool to see that your server is creating a proper spec file. If you want to learn
|
||||
more about the spec file and format, please see [swagger-core](https://github.com/wordnik/swagger-core/wiki). This
|
||||
more about the spec file and format, please see [swagger-core](https://github.com/swagger-spec). This
|
||||
tool will read the server and generate a report of any violations of the spec. If there are violations, the
|
||||
client codegen and ui may not work correctly.
|
||||
|
||||
@ -183,35 +181,35 @@ If you need to make static pages or don't want the sandbox of the swagger-ui, yo
|
||||
Will produce the output here:
|
||||
|
||||
```
|
||||
https://github.com/wordnik/swagger-codegen/tree/master/samples/swagger-static-docs/docs
|
||||
https://github.com/swagger-api/swagger-codegen/tree/master/samples/swagger-static-docs/docs
|
||||
```
|
||||
|
||||
which is based on these templates:
|
||||
|
||||
```
|
||||
https://github.com/wordnik/swagger-codegen/tree/master/src/main/resources/swagger-static
|
||||
https://github.com/swagger-api/swagger-codegen/tree/master/src/main/resources/swagger-static
|
||||
```
|
||||
|
||||
and looks like this
|
||||
|
||||

|
||||

|
||||
|
||||
### To build a server stub
|
||||
|
||||
You can also use the codegen to generate a server for a couple different frameworks. Take a look here:
|
||||
|
||||
* [javascript node.js Server generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/node)
|
||||
* [javascript node.js Server generator](https://github.com/swagger-api/swagger-codegen/tree/master/samples/server-generator/node)
|
||||
|
||||
* [ruby sinatra generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/sinatra)
|
||||
* [ruby sinatra generator](https://github.com/swagger-api/swagger-codegen/tree/master/samples/server-generator/sinatra)
|
||||
|
||||
* [scala scalatra generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/scalatra)
|
||||
* [scala scalatra generator](https://github.com/swagger-api/swagger-codegen/tree/master/samples/server-generator/scalatra)
|
||||
|
||||
* [java jax-rs generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/java-jaxrs)
|
||||
* [java jax-rs generator](https://github.com/swagger-api/swagger-codegen/tree/master/samples/server-generator/java-jaxrs)
|
||||
|
||||
|
||||
### Migrating from Swagger 1.1 to 1.2 format
|
||||
|
||||
If you've spent time hand-crafting your swagger spec files, you can use the [SpecConverter](https://github.com/wordnik/swagger-codegen/blob/master/src/main/scala/com/wordnik/swagger/codegen/SpecConverter.scala) to do the dirty work. For example:
|
||||
If you've spent time hand-crafting your swagger spec files, you can use the [SpecConverter](https://github.com/swagger-api/swagger-codegen/blob/master/src/main/scala/com/wordnik/swagger/codegen/SpecConverter.scala) to do the dirty work. For example:
|
||||
|
||||
```bash
|
||||
$ ./bin/update-spec.sh http://developer.wordnik.com/v4/resources.json wordnik-developer
|
||||
@ -245,7 +243,7 @@ either repackage the library OR modify your codegen script to use a file path!
|
||||
License
|
||||
-------
|
||||
|
||||
Copyright 2014 Wordnik, Inc.
|
||||
Copyright 2014 Reverb Technologies, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
41
samples/server-generator/php/PHPServerGenerator.scala
Normal file
41
samples/server-generator/php/PHPServerGenerator.scala
Normal file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Copyright 2014 Wordnik, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import com.wordnik.swagger.codegen.BasicPHPGenerator
|
||||
|
||||
import scala.collection.mutable.{ HashMap, ListBuffer }
|
||||
|
||||
object PHPServerGenerator extends BasicPHPGenerator {
|
||||
def main(args: Array[String]) = generateClient(args)
|
||||
|
||||
override def templateDir = "samples/server-generator/php/templates"
|
||||
|
||||
val outputFolder = "samples/server-generator/php/output"
|
||||
|
||||
// where to write generated code
|
||||
override def destinationDir = outputFolder + ""
|
||||
|
||||
apiTemplateFiles.clear
|
||||
|
||||
modelTemplateFiles.clear
|
||||
|
||||
// supporting classes
|
||||
override def supportingFiles = List(
|
||||
("README.mustache", outputFolder, "README.md"),
|
||||
("composer.json", outputFolder, "composer.json"),
|
||||
(".htaccess", outputFolder, ".htaccess"),
|
||||
("index.mustache", outputFolder, "index.php"))
|
||||
}
|
59
samples/server-generator/php/README.md
Normal file
59
samples/server-generator/php/README.md
Normal file
@ -0,0 +1,59 @@
|
||||
# Swagger generated server
|
||||
|
||||
## Overview
|
||||
Using the swagger-codegen, you can not only generate clients but servers as well! The same spec can be used to drive your
|
||||
development both ways. This is an example of generating a server for `PHP`.
|
||||
|
||||
### Prerequisites
|
||||
You need the following installed and available in your $PATH:
|
||||
|
||||
<li>- Scala 2.9.1 [available here](http://www.scala-lang.org)
|
||||
|
||||
You also need to add scala binary to your PATH.
|
||||
|
||||
You need an apache server running with mod_rewrite enabled
|
||||
|
||||
### Generating a server
|
||||
You first need to build the `swagger-codegen` project--this is done by running this command at the root of the swagger-codegen project:
|
||||
|
||||
```
|
||||
mvn package
|
||||
```
|
||||
|
||||
You can now generate a server from any valid[**](https://github.com/swagger-api/swagger-codegen/blob/master/README.md#validating-your-swagger-spec) swagger spec:
|
||||
|
||||
```
|
||||
./bin/runscala.sh samples/server-generator/php/PHPServerFromSpec.scala http://petstore.swagger.wordnik.com/api/api-docs special-key
|
||||
```
|
||||
|
||||
After executing this script, you will have an output directory with the server-generated files:
|
||||
|
||||
```
|
||||
$ cd samples/server-generator/php/output
|
||||
$ find . -type f
|
||||
./.htaccess
|
||||
./composer.json
|
||||
./index.php
|
||||
./README.md
|
||||
```
|
||||
|
||||
To install the dependencies, cd to the `samples/server-generator/php/output` folder and run:
|
||||
|
||||
```
|
||||
$ curl -s http://getcomposer.org/installer | php
|
||||
$ php composer.phar install
|
||||
```
|
||||
|
||||
You can now access the api by going to `http://localhost/path-to-output-dir/`. Of course this isn't a fully
|
||||
runnable server! You have to add the logic in the index.php file. But that's the easy part.
|
||||
|
||||
|
||||
### Making it your own
|
||||
Running the sample is easy, but how about making your own server? Easy! Just modify the `samples/server-generator/php/PHPServerGenerator.scala` file.
|
||||
|
||||
Don't like the templates? Don't worry, we're not offended! They're [mustache](http://mustache.github.com/) templates and are easy to modify.
|
||||
Take a look at the sample templates here:
|
||||
|
||||
<li> - Generator for the index.php file : [api.mustache](https://github.com/swagger-api/swagger-codegen/blob/master/samples/server-generator/php/templates/index.mustache)
|
||||
|
||||
Sound easy? It is!
|
5
samples/server-generator/php/output/.htaccess
Normal file
5
samples/server-generator/php/output/.htaccess
Normal file
@ -0,0 +1,5 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
|
||||
</IfModule>
|
10
samples/server-generator/php/output/README.md
Normal file
10
samples/server-generator/php/output/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Swagger generated server
|
||||
|
||||
## Overview
|
||||
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the
|
||||
[swagger-spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This
|
||||
is an example of building a PHP server.
|
||||
|
||||
This example uses the [Silex](http://silex.sensiolabs.org/) micro-framework. To see how to make this your own, look here:
|
||||
|
||||
[README](https://github.com/swagger-api/swagger-codegen/tree/master/samples/server-generator/php)
|
5
samples/server-generator/php/output/composer.json
Normal file
5
samples/server-generator/php/output/composer.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"require": {
|
||||
"silex/silex": "~1.2"
|
||||
}
|
||||
}
|
98
samples/server-generator/php/output/index.php
Normal file
98
samples/server-generator/php/output/index.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Silex\Application;
|
||||
|
||||
$app = new Silex\Application();
|
||||
|
||||
$app->POST('/user/createWithArray', function(Application $app, Request $request) {
|
||||
return new Response('How about implementing createUsersWithArrayInput as a POST method ?');
|
||||
});
|
||||
|
||||
$app->POST('/user/createWithList', function(Application $app, Request $request) {
|
||||
return new Response('How about implementing createUsersWithListInput as a POST method ?');
|
||||
});
|
||||
|
||||
$app->PUT('/user/{username}', function(Application $app, Request $request, $username) {
|
||||
return new Response('How about implementing updateUser as a PUT method ?');
|
||||
});
|
||||
|
||||
$app->DELETE('/user/{username}', function(Application $app, Request $request, $username) {
|
||||
return new Response('How about implementing deleteUser as a DELETE method ?');
|
||||
});
|
||||
|
||||
$app->GET('/user/{username}', function(Application $app, Request $request, $username) {
|
||||
return new Response('How about implementing getUserByName as a GET method ?');
|
||||
});
|
||||
|
||||
$app->GET('/user/login', function(Application $app, Request $request) {
|
||||
$username = $request->get('username');
|
||||
$password = $request->get('password');
|
||||
return new Response('How about implementing loginUser as a GET method ?');
|
||||
});
|
||||
|
||||
$app->GET('/user/logout', function(Application $app, Request $request) {
|
||||
return new Response('How about implementing logoutUser as a GET method ?');
|
||||
});
|
||||
|
||||
$app->POST('/user', function(Application $app, Request $request) {
|
||||
return new Response('How about implementing createUser as a POST method ?');
|
||||
});
|
||||
|
||||
$app->PUT('/pet', function(Application $app, Request $request) {
|
||||
return new Response('How about implementing updatePet as a PUT method ?');
|
||||
});
|
||||
|
||||
$app->POST('/pet', function(Application $app, Request $request) {
|
||||
return new Response('How about implementing addPet as a POST method ?');
|
||||
});
|
||||
|
||||
$app->GET('/pet/findByStatus', function(Application $app, Request $request) {
|
||||
$status = $request->get('status');
|
||||
return new Response('How about implementing findPetsByStatus as a GET method ?');
|
||||
});
|
||||
|
||||
$app->GET('/pet/findByTags', function(Application $app, Request $request) {
|
||||
$tags = $request->get('tags');
|
||||
return new Response('How about implementing findPetsByTags as a GET method ?');
|
||||
});
|
||||
|
||||
$app->POST('/pet/{petId}', function(Application $app, Request $request, $petId) {
|
||||
$name = $request->get('name');
|
||||
$status = $request->get('status');
|
||||
return new Response('How about implementing updatePetWithForm as a POST method ?');
|
||||
});
|
||||
|
||||
$app->GET('/pet/{petId}', function(Application $app, Request $request, $petId) {
|
||||
return new Response('How about implementing getPetById as a GET method ?');
|
||||
});
|
||||
|
||||
$app->DELETE('/pet/{petId}', function(Application $app, Request $request, $petId) {
|
||||
return new Response('How about implementing deletePet as a DELETE method ?');
|
||||
});
|
||||
|
||||
$app->PATCH('/pet/{petId}', function(Application $app, Request $request, $petId) {
|
||||
return new Response('How about implementing partialUpdate as a PATCH method ?');
|
||||
});
|
||||
|
||||
$app->POST('/pet/uploadImage', function(Application $app, Request $request) {
|
||||
$additionalMetadata = $request->get('additionalMetadata');
|
||||
$file = $request->get('file');
|
||||
return new Response('How about implementing uploadFile as a POST method ?');
|
||||
});
|
||||
|
||||
$app->POST('/store/order', function(Application $app, Request $request) {
|
||||
return new Response('How about implementing placeOrder as a POST method ?');
|
||||
});
|
||||
|
||||
$app->DELETE('/store/order/{orderId}', function(Application $app, Request $request, $orderId) {
|
||||
return new Response('How about implementing deleteOrder as a DELETE method ?');
|
||||
});
|
||||
|
||||
$app->GET('/store/order/{orderId}', function(Application $app, Request $request, $orderId) {
|
||||
return new Response('How about implementing getOrderById as a GET method ?');
|
||||
});
|
||||
|
||||
$app->run();
|
5
samples/server-generator/php/templates/.htaccess
Normal file
5
samples/server-generator/php/templates/.htaccess
Normal file
@ -0,0 +1,5 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
|
||||
</IfModule>
|
10
samples/server-generator/php/templates/README.mustache
Normal file
10
samples/server-generator/php/templates/README.mustache
Normal file
@ -0,0 +1,10 @@
|
||||
# Swagger generated server
|
||||
|
||||
## Overview
|
||||
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the
|
||||
[swagger-spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This
|
||||
is an example of building a PHP server.
|
||||
|
||||
This example uses the [Silex](http://silex.sensiolabs.org/) micro-framework. To see how to make this your own, look here:
|
||||
|
||||
[README](https://github.com/swagger-api/swagger-codegen/tree/master/samples/server-generator/php)
|
5
samples/server-generator/php/templates/composer.json
Normal file
5
samples/server-generator/php/templates/composer.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"require": {
|
||||
"silex/silex": "~1.2"
|
||||
}
|
||||
}
|
26
samples/server-generator/php/templates/index.mustache
Normal file
26
samples/server-generator/php/templates/index.mustache
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Silex\Application;
|
||||
|
||||
$app = new Silex\Application();
|
||||
|
||||
{{#apiInfo}}
|
||||
{{#apis}}
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
|
||||
$app->{{httpMethod}}('{{path}}', function(Application $app, Request $request{{#pathParams}}, ${{paramName}}{{/pathParams}}) {
|
||||
{{#queryParams}}${{paramName}} = $request->get('{{paramName}}');{{newline}} {{/queryParams}}
|
||||
{{#formParams}}${{paramName}} = $request->get('{{paramName}}');{{newline}} {{/formParams}}
|
||||
return new Response('How about implementing {{nickname}} as a {{httpMethod}} method ?');
|
||||
});
|
||||
|
||||
{{/operation}}
|
||||
{{/operations}}
|
||||
{{/apis}}
|
||||
{{/apiInfo}}
|
||||
|
||||
$app->run();
|
31
specs/extra.sbt
Normal file
31
specs/extra.sbt
Normal file
@ -0,0 +1,31 @@
|
||||
val wordnikSnapshots = "Wordnik Snapshots" at "https://ci.aws.wordnik.com/artifactory/m2-snapshots/"
|
||||
|
||||
val wordnikReleases = "Wordnik Releases" at "https://ci.aws.wordnik.com/artifactory/m2-releases/"
|
||||
|
||||
val wordnikRemoteRepos = "Wordnik Remote Repos" at "https://ci.aws.wordnik.com/artifactory/remote-repos/"
|
||||
|
||||
scalaVersion := "2.11.2"
|
||||
|
||||
crossScalaVersions := Seq("2.10.4", "2.11.2")
|
||||
|
||||
scalacOptions ++= Seq("-unchecked", "-deprecation", "-optimize", "-Xcheckinit", "-encoding", "utf8")
|
||||
|
||||
version := "1.6.1"
|
||||
|
||||
publishTo <<= (version) { version: String =>
|
||||
val artifactory = "https://ci.aws.wordnik.com/artifactory/m2-"
|
||||
if (version.trim.endsWith("SNAPSHOT"))
|
||||
Some("snapshots" at artifactory + "snapshots")
|
||||
else
|
||||
Some("releases" at artifactory + "releases")
|
||||
}
|
||||
|
||||
publishMavenStyle := true
|
||||
|
||||
publishArtifact in Test := false
|
||||
|
||||
pomIncludeRepository := { x => false }
|
||||
|
||||
credentials += Credentials("Artifactory Realm", "ci.aws.wordnik.com", "mavenuser", "DEEaffe987a")
|
||||
|
||||
resolvers ++= Seq(wordnikSnapshots, wordnikReleases, wordnikRemoteRepos)
|
@ -2,10 +2,10 @@ organization := "{{package}}"
|
||||
|
||||
name := "{{projectName}}-client"
|
||||
|
||||
libraryDependencies += "com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.0-WN5"
|
||||
libraryDependencies += "com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.5"
|
||||
|
||||
libraryDependencies += "joda-time" % "joda-time" % "2.3"
|
||||
libraryDependencies += "joda-time" % "joda-time" % "2.5"
|
||||
|
||||
libraryDependencies += "org.joda" % "joda-convert" % "1.3.1"
|
||||
libraryDependencies += "org.joda" % "joda-convert" % "1.7"
|
||||
|
||||
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.0.13" % "provided"
|
||||
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.1.2" % "provided"
|
||||
|
@ -97,6 +97,7 @@ class BasicPythonGenerator extends BasicGenerator {
|
||||
}
|
||||
}
|
||||
override def typeMapping = Map(
|
||||
"integer" -> "int",
|
||||
"float" -> "float",
|
||||
"long" -> "long",
|
||||
"double" -> "float",
|
||||
|
@ -1,20 +1,14 @@
|
||||
package com.wordnik.swagger.codegen
|
||||
|
||||
import scala.collection.mutable
|
||||
import java.io.{File, FileWriter}
|
||||
import java.io.File
|
||||
|
||||
import com.wordnik.swagger.codegen.language.CodegenConfig
|
||||
import com.wordnik.swagger.codegen.model._
|
||||
import scala.collection.mutable.{HashMap, ListBuffer}
|
||||
import language.CodegenConfig
|
||||
import scala.io.Source
|
||||
import org.json4s.jackson.Serialization._
|
||||
import org.fusesource.scalate.{Template, TemplateSource, TemplateEngine}
|
||||
import org.apache.commons.io.FileUtils
|
||||
import com.wordnik.swagger.codegen.util.{CoreUtils, ApiExtractor, ResourceExtractor}
|
||||
import com.wordnik.swagger.codegen.spec.SwaggerSpecValidator
|
||||
import mojolly.inflector.InflectorImports._
|
||||
import org.rogach.scallop.{ScallopConf, Scallop}
|
||||
import scala.annotation.switch
|
||||
import org.rogach.scallop.ScallopConf
|
||||
|
||||
import scala.collection.JavaConverters._
|
||||
import scala.collection.mutable.HashMap
|
||||
|
||||
case class SwaggerApi(
|
||||
clientName: String,
|
||||
@ -119,7 +113,8 @@ object ScalaAsyncClientGenerator extends App {
|
||||
props += "fileMap" -> resUrl
|
||||
|
||||
props += "clientName" -> cfg.api.clientName.underscore.pascalize
|
||||
|
||||
props += "projectName" -> cfg.api.clientName.underscore.dasherize
|
||||
|
||||
clientOpts.properties = props.toMap.asJava
|
||||
|
||||
println(appBanner)
|
||||
|
Loading…
x
Reference in New Issue
Block a user