Skip to content

Commit

Permalink
Merge branch 'swagger-codegen_renamed' into 'master' (#183)
Browse files Browse the repository at this point in the history
* Added vendorExtensions.x-isPrimitive. (#7991)

* Added vendorExtensions.x-isPrimitive.

Switch template for constructFromObject.

* Reflect review indication.

* [typescript-angular] AOT-compatible API client (via ng-packagr and ngc) (#7984)

* typescript-angular: uses ng-packagr for the build

see swagger-api/swagger-codegen#6722
see swagger-api/swagger-codegen#6735

* this should make everybody happy: Angular 2/4/5 AOT support

- uses ngc when targeting Angular 2 (as seen in swagger-api/swagger-codegen#6735)
- uses ng-packagr 1 when targeting Angular 4
- uses ng-packagr 2 when targeting Angular 5

* removes bogus import

* cleans / updates Petstore samples, adds a new sample for Angular 5

* typo in README

* fixes broken travis build. adds pom.xml files again

This reverts commit 471d248a2e9b5d8eed10c71644c222c053e007b0.

* makes usage of `dist` more clear

and i feel generally better when `npm run build` is called explicitly.

- for ng-packagr 2 is doesn't matter, since the final package.json does not have any scripts
- for old ng-packagr 1 it matters, scripts are copied to the final package.json which breaks installation via `npm install {{npmName}} --save` (it runs `npm run build` again)

* typescript-angular: small improvements as suggested by @macjohnny

* angular-typescript: updated petstore samples, 3rd try

* Issue 5542, always generate pom and readme (#7977)

* Issue 5542, generate pom.xml with separate parameter. InterfaceOnly=true for not generating pom.xml not works in every situation.

* Issue 5542, generate pom.xml with separate parameter. InterfaceOnly=true for not generating pom.xml not works in every situation.

* Issue #5542 Always generate pom.xml and README.md

* [TypeScript][Angular] fix date path parameters (#7476, #7302) (#7479)

* #7476, #7302: [TypeScript][Angular] fix date path parameters, fix path parameters with :.+ in it

* #7476, #7302: [TypeScript][Angular] fix date path parameters, fix path parameters with :.+ in it

* #7476, #7302: [TypeScript][Angular] fix date path parameters, fix path parameters with :.+ in it

* #7476: generate samples

* code cleanup

* #7476: improve variable description

* #7302: revert character skipping, since it will now have the same parameter name in the method signature and in the api path

* #7302: generate samples

* typescript-angular: added Interfaces to api exports if withInterfaces is selected (#7975)

* added Interfaces to api exports if withInterfaces is selected

* removed import of interface classes

* added gererated petstore example api.ts

* Fix Issue 8014

* Adapted to work with Angular2 Http and Angular 4.3+ HttpClient

* removed unnecessary (others) for ng HttpClient from Interface

* Golang Client Refactor (body and model in errors, typed optional parameters) (#7987)

* Return abstracted errors with model data if available.

* update tests with error models.

* Return error models on the abstract type.

* dont leak FH

* duplicate of PR #7752 for issue #7511

* Change optional parameters to structs.

* update documentation

* fix circleCI failure

* [typescript][angular] query parameter with null value should not be set (#8033)

* #7893: [typescript][angular] fix optional query parameter null value

* #7893: [typescript][angular] generate samples

* #7893: [typescript][angular] generate samples

* Version rest-assured has been updated to 3.1.0 (#8052)

* [Dart] Fixes TypeError in Dart 2 mode (#7959)

* Properly convert lists to dart types

* Updated sample petstore client

* Fixed maps in Dart strong mode
Fixed list parsing for null-elements

* change parseDate in es6/APIClient (#7973)

* [PHP] Improve duplicated validation logic (#7954)

* Improve duplicated validation logic

* Update the samples
  • Loading branch information
jmini authored and wing328 committed Apr 22, 2018
1 parent 52114ec commit ed307c2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 28 deletions.
27 changes: 2 additions & 25 deletions .generator/templates/libraries/rest-assured/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ public class {{classname}} {
private RequestSpecBuilder reqSpec;
private JSON json;
private {{classname}}(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
this.json = new JSON();
}

public static {{classname}} {{classVarName}}(RequestSpecBuilder reqSpec) {
Expand All @@ -53,26 +50,6 @@ public class {{classname}} {
{{/operation}}
{{/operations}}

/**
* Get JSON
*
* @return JSON object
*/
public JSON getJSON() {
return json;
}

/**
* Set JSON
*
* @param json JSON object
* @return {{classname}}
*/
public {{classname}} setJSON(JSON json) {
this.json = json;
return this;
}

/**
* Customise request specification
*/
Expand Down Expand Up @@ -152,7 +129,7 @@ public class {{classname}} {
*/
public {{{returnType}}} executeAs(Function<Response, Response> handler) {
Type type = new TypeToken<{{{returnType}}}>(){}.getType();
return getJSON().deserialize(execute(handler).asString(), type);
return execute(handler).as(type);
}
{{/returnType}}
{{#bodyParams}}
Expand All @@ -161,7 +138,7 @@ public class {{classname}} {
* @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
*/
public {{operationIdCamelCase}}Oper body({{{dataType}}} {{paramName}}) {
reqSpec.setBody(getJSON().serialize({{paramName}}));
reqSpec.setBody({{paramName}});
return this;
}
{{/bodyParams}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ if(hasProperty('target') && target == 'android') {

ext {
swagger_annotations_version = "1.5.15"
rest_assured_version = "3.0.6"
rest_assured_version = "3.1.0"
junit_version = "4.12"
gson_version = "2.6.1"
gson_fire_version = "1.8.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ lazy val root = (project in file(".")).
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
"io.swagger" % "swagger-annotations" % "1.5.15",
"io.rest-assured" % "scala-support" % "3.0.6",
"io.rest-assured" % "scala-support" % "3.1.0",
"com.google.code.gson" % "gson" % "2.6.1",
"io.gsonfire" % "gson-fire" % "1.8.2" % "compile",
{{#joda}}
Expand Down
2 changes: 1 addition & 1 deletion .generator/templates/libraries/rest-assured/pom.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-core-version>1.5.15</swagger-core-version>
<rest-assured.version>3.0.6</rest-assured.version>
<rest-assured.version>3.1.0</rest-assured.version>
<gson-version>2.6.1</gson-version>
<gson-fire-version>1.8.2</gson-fire-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
Expand Down

0 comments on commit ed307c2

Please sign in to comment.