Commit Graph

7025 Commits

Author SHA1 Message Date
Akihito Nakano
5f2d79b669 Resolve inline models before preprocess (#1761) 2018-12-28 11:13:30 +08:00
William Cheng
177deb918a
better handling of allOf (composition) (#1757) 2018-12-27 16:01:18 +08:00
Akihito Nakano
5d98fc6beb
Fix UUID support (#1746)
* Add custom type adapter to deserialize UUID

* Update samples

./bin/kotlin-client-threetenbp.sh
./bin/kotlin-client-string.sh
./bin/kotlin-client-petstore.sh
2018-12-27 08:59:57 +09:00
Daiki Matsudate
292d987f15 Use appInfo.version for podspec (#1760) 2018-12-27 00:19:29 +08:00
Daiki Matsudate
c2273a651a [Swift 4] Add createURLRequest method (#1727)
* add create URL Request method

* add comment
2018-12-27 00:19:11 +08:00
William Cheng
902a4b4099
remove self-reference import (#1758) 2018-12-26 18:11:26 +08:00
Daiki Matsudate
c13e089c85 [swift4] Use RequestBuilder directly for RxSwift and PromiseKit (#1718)
* remove default implementation

* avoid insert blank lines
2018-12-26 18:01:26 +08:00
William Cheng
c62a1f11ee
maven dep version update (#1754) 2018-12-26 10:53:53 +08:00
Akihito Nakano
aa1cfd81fe Minor fixes for InlineModelResolver (#1756)
* Delete unused methods

* Improve access modifiers declaration

* InlineModelResolver#flatten can be package-private

* Delete unused import declaration

* Sort properties
2018-12-26 10:53:39 +08:00
William Cheng
e4f80dcc0e
various fix for free-form object (#1751) 2018-12-26 10:38:07 +08:00
William Cheng
120c0a05f0
Restore Ruby tests after parser update (#1753)
* uncomment ruby test after parser update

* remove comment
2018-12-26 10:36:58 +08:00
zigen
7595baef00 Fix composed oneof type 1749 (#1750)
* add test to check that DefaultCodegen generates composed oneof schema properly

* fix composed-oneof type generation bug (#1749)
2018-12-24 17:46:42 +08:00
William Cheng
0dee995ebb
Fix discriminator name not following variable naming convention (#1742)
* fix discrimintator name not following variable naming convention

* fix test

* update samples

* use discriminator name directly in php

* single quote array index
2018-12-24 10:17:43 +08:00
tanmen
aed2c882da add nullable support to typescript-axios (#1743) 2018-12-24 00:59:13 +08:00
Jim Schubert
92badd8d49 [kotlin-spring] Allow DateTime to be remapped to others (LocalDateTIme) (#1740) 2018-12-24 00:34:47 +08:00
Yuriy Belenko
72dcee9d86 [Slim] Abstract API controllers (#1483)
* [Slim] Add abstract prefix to API controllers

* [Slim] Add userClassname property to codegen

* [Slim] Add src folder to Composer autoload

* [Slim] Change template to produce abstract controllers

* [Slim] Update API tests template

* [Slim] Add implementation note

* [Slim] Remove deprecated AbstractApiController

* [Slim] Refresh samples
2018-12-23 23:51:26 +08:00
Akihito Nakano
f1831533d4 [Java] Update dependencies (#1735)
* Update retrofit2

refs:
https://nvd.nist.gov/vuln/detail/CVE-2018-1000850
https://nvd.nist.gov/vuln/detail/CVE-2018-1000844

* Update samples

./bin/java-petstore-all.sh

* Implement okhttp3.Call#timeout

refs https://github.com/square/okhttp/pull/4363

* Update samples

./bin/java-petstore-all.sh

* Update Play26CallFactory

* Fix indent
2018-12-23 19:03:50 +08:00
Akihito Nakano
05107032d1
Fix missing closing parenthesis (#1739)
* Add a script to generate kotlin client samples from OAS3

* Generate kotlin client

* Fix missing closing parenthesis

* Update samples

* Add build folder to gitignore
2018-12-23 09:54:51 +09:00
William Cheng
667275fb25
Fix C# client warnings (#1737)
* fix csharp warnings

* fix incorrect line break removal
2018-12-23 08:06:55 +08:00
Jérémie Bresson
a7dfc650b6 Swagger parser update: 2.0.8-OpenAPITools.org-1 (#1721)
* Update Swagger-Parser Version

* Update samples

* surpress javadoc warning

* fix TS tests

* Set version to 2.0.8-OpenAPITools.org-1
2018-12-22 18:12:08 +08:00
Steven Masala
43abd61144 Typescript nullable (#1730)
* fix name sanitation when using kebab case filenaming

* remove whitespaces

* nullable

* remove test comment
2018-12-22 16:49:44 +08:00
William Cheng
77edec0c65
Revert "[Rust] Support formParams and fix list-params." (#1732)
* Revert "Disable rust-reqwest petstore test"

This reverts commit 9e1cce2e7b.

* Revert "Fix various CI issues (#1722)"

This reverts commit 77270a0118.

* Revert "[Rust] Support formParams and fix list-params. (#1678)"

This reverts commit 4a494b45d3.
2018-12-22 16:28:55 +08:00
Marco Farrugia
4a494b45d3 [Rust] Support formParams and fix list-params. (#1678)
* [Rust] Support formParams and fix list-params.

Form params were previously unsupported, and list-params would produce code that didn't compile.

* update rust samples
2018-12-21 10:08:00 +08:00
Jim Schubert
10ecc0e52f [csharp-refactor] Minor csharp refactor changes (#1723)
* [csharp-refactor] Minor changes to JSON mime usage

🐎 This maeks the regex static to reduce GC overhead for active clients.
This also removes the lowercase call on the mimetype before evaluating,
as the regex already uses the inline modifier for case insensitivity.

* [csharp-refactor] Regenerate sample
2018-12-21 09:57:38 +08:00
Tomasz Prus
89a0ffa66c feat: [python/asyncio] use ssl argument instead of ssl_context (deprecated from aiohttp>=3.0.0) (#1724) 2018-12-21 09:52:27 +08:00
Jérémie Bresson
d38b9e588b
[core] support for 'x-enum-varnames' for enums in arrays (#1703) 2018-12-20 16:30:34 +01:00
William Cheng
b6e80e86b2
Add nullable support to JAXRS-CXF parameters (#1679)
* add nullable support to jaxrs cxf parameters

* remove end of file line break

* fix default value for list

* update samples
2018-12-20 16:07:45 +08:00
William Cheng
f188fa08e5
fix enum and map of neum (regression) (#1706) 2018-12-20 16:07:22 +08:00
William Cheng
93c13074ff
various fixes to csharp refactor client (#1711) 2018-12-20 16:06:29 +08:00
Daiki Matsudate
9ff8a24895 fix description (#1710) 2018-12-20 15:55:29 +08:00
gndrm
98ae7a816c Introduced GeneratorProperties as a thread-safe clone of System Properties (#1598)
* Introduced GeneratorProperties as a thread-safe clone of System Properties

* Removed unnecessary SmartBear copyright
2018-12-19 21:46:05 +08:00
William Cheng
81cf611aa4
add nullable support to perl api parameter (#1690) 2018-12-17 17:11:23 +08:00
William Cheng
d7d994620c
Add multiple inheritance support to Perl client (#1681)
* add multiple inheritance support to perl client

* remove allof test from fake petstore
2018-12-17 15:28:20 +08:00
William Cheng
b6a23986b3
fix java instantiated lists (#1683) 2018-12-17 14:42:04 +08:00
Joe Elliott
33fbd9c78b [Swift] Updates for Swift 4.2 (#1443)
* [Swift] Update Alamofire version and update tests and Swift version to 4.2 for default and RxSwift variants

* Update promiseKit for Swift 4.0

* Update project files.

* Merge branch 'master' of https://github.com/OpenAPITools/openapi-generator into OpenAPITools-master

# Conflicts:
#	samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj

* Merge in latest master

* Remove typo in bash file
2018-12-17 15:41:06 +09:00
Yuriy Belenko
3896821d5e [Slim] Add phplint cache to gitignore (#1686)
* [Slim] Add phplint cache to gitignore

* [Slim] Refresh samples
2018-12-17 14:21:39 +08:00
William Cheng
fb15a4baf3 [core] Update parser and core to latest version (#1569)
* Update swagger-parser to 2.0.7
* Update swagger-core to 2.0.6
2018-12-17 06:56:46 +01:00
William Cheng
c05dc24e6a
Mark swift3 generator as deprecated (#1675)
* mark swift3 as deprecated

* update windows batch scripts
2018-12-16 19:20:37 +08:00
David Cloutier
06150767f4 Proposed fix for issues #1654. fix isSerializable for java jaxrs-cxf (#1656)
* Update model.mustache

fix serializable import for cxf-cdi

* Update pojo.mustache

add implements to the pojo if isSerializable is true

* Update model.mustache

add import statement to fix compile issue when {{#serializableModel}} is true

* Update pojo.mustache

remove extra space to prevent unecessary diffs in petstore examples: diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/*
2018-12-15 17:04:45 +08:00
Dec12 | Fujigon
7609398150 Fix the bug header bean validation is not performed (#1661)
* update template

* update template

* update samples
2018-12-15 16:37:25 +08:00
meganemura
82fcde1d91 Improve model class of ruby-client (#1670)
* Add Model.build_from_hash

* Use Model.build_from_hash instead of Model.new.build_from_hash

* Update sample for ruby-client

* Update sample for openapi3 ruby-client
2018-12-15 16:24:03 +08:00
William Cheng
8c599ebf12
Add support for multiple inheritance (#1664)
* add all parent names

* clean up supportsInheritance

* fix npe

* fix allVars, fix test cases

* add more tests, remove comments

* update docker m2 cache dir, add more tests, fix mandatory

* update samples

* regenerate js spec files

* add logic to detect self reference

* add isSelfReference flag to codegen property

* add ruby tests for cat model

* remove debugging info

* fix JS allvars not have x-js-doctype

* update samples

* update js samples
2018-12-15 00:24:36 +08:00
William Cheng
587bd56655
add mavencentral to build.gradle (#1674) 2018-12-15 00:22:11 +08:00
Jim Schubert
1f95b54cef Include mavenCentral in java build.gradle (#1653)
the android dep is currently missing from jcenter. This adds
mavenCentral as an additional repository to the default java generator's
build.gradle.
2018-12-14 21:23:06 +08:00
ccozzolino
95c744381b [JAVA][Server] Fixed issue #1525: Fix model class field initializations (Regression since 3.3.1) (#1549)
* Fixed issue #1525. Adjust class field declarations with proper initializations.

* Adjusted templates to add default only when it is exists.
2018-12-13 01:11:47 +08:00
William Cheng
66cff2b05a
fix alias to free form object & map (#1638) 2018-12-10 22:46:41 +08:00
feihongmeilian
489c404783 Add instructions for erlang-server (#1643) 2018-12-10 17:45:19 +08:00
Denis Korenevskiy
a27224e50d [php] bugfix: Array and Map inner schema definition can be missing. (#1586) 2018-12-10 17:43:44 +08:00
Juan Facorro
87bc9d436f Introduce optional weight function for commands and other improvements (#1618)
* Generator erlang-proper

Used to generate PropEr generators for property-based testing

* Rearrange *_statem.erl functions and remove *_statem.hrl

* Optional weight function

* Optional argument to override generated values

* Export function with arity 1

* Move syntactic sugar to header file

* Only provide body when its allowed

* The weight function should not depend on the state
2018-12-10 11:41:12 +08:00
Akihito Nakano
f19794464b
Delete --lang option (#1592)
* Delete --lang option

* Fix -l

* Fix -l flag (windows)

* Add migration guide

* Change to -g

* Remove lang option

* Change to -g
2018-12-09 19:26:51 +09:00
Akihito Nakano
7e3e9dba11 Replace Class.newInstance() with Constructor.newInstance() (#1635) 2018-12-08 22:31:57 +08:00
John Bush
c4f0521e10 Fix escaped regex values in Python client (#1517). (#1539)
* Fix escaped regex values in Python client (#1517).

* Override PythonClientCodegen toRegularExpression() method to correct
  issue with backslashes being escaped. This issue was a result of
  calling escapeText() in the parent DefaultCodegen class.

* Only escape unescaped forward slashes in PythonClientCodegen.

* Override addRegularExpressionDelimiter in PythonClientCodegen.java
  such that only unescaped forward slashes in the pattern get escaped.
* Adds a new test resource .yaml file for specifically testing this
  issue.

* Check for regular expression modifiers in PythonClientCodegen.

* Adds check in postProcessPattern() in PythonClientCodegen.java to
  check if regular expression has modifiers defined. If so, it throws an
  exception as modifiers are not currently supported in the Python
  client.

* PythonClientCodegen warns that regex modifiers are not supported.

* Changes behavior in PythonClientCodegen.java to no longer throw an
  IllegalArgumentException in the case that a pattern contains
  modifiers. A warning message will be logged instead stating that
  modifiers are not currently supported by the codegen class.

* Remove warning for PythonClientCodegen regex modifier support.

* Removes warning message from PythonClientCodegen.java stating that
  regular expression modifiers are not currently supported. Further
  code review and testing revealed that this feature is already
  supported and working.

* Add updated Python client sample files.
2018-12-08 11:32:55 +08:00
Phil Adams
2d39f14882 Fix NPE in ModelUtils.isFreeFormObject() (#1625)
Fixes #1696

An object schema containing no properties that also has additionalProperties
set to an object schema with no properties will cause
ModelUtils.isFreeFormObject to throw an NPE.
This PR adds additional checking to avoid the NPE.
2018-12-07 23:16:58 +08:00
William Cheng
2f4bea6967
remove isNotContainer (#1629) 2018-12-07 23:10:35 +08:00
Tomek Cejner
922532da6a [core] Prevent NPE when enpoint did not define responses (#1617) 2018-12-07 11:57:16 +01:00
William Cheng
774013c7e1
Better OpenAPI spec v3 support: allOf, anyOf, oneOf (#1360)
* add oneOf support to Ruby

* add anyOf support to ruby client

* add discriminator support to ruby client

* fix typo

* update samples, fix NPE

* better format in ruby generator

* fix test cases, disable mapping test

* fix update script, update samples

* add test, fix mapping

* update exit code

* reenabled discriminator test

* remove duplicated properties

* add test for duplicated properties

* update samples, add new spec

* fix ruby test cases

* fix hasMore after removing duplicates

* refactor method, comment out haskell client test

* fix hasMore and update samples

* fix parent detection

* fix discriminator check

* [haskell-http-client] need to use {{vars}}{{required}} instead of {{requiredVars}}

* remove deprecated methods in default codegen (#1031)

* regenerate samples

* remove commented code
2018-12-07 00:30:20 +08:00
Erik Timmers
c0634ac213 [elm] Enable setting Http request trackers (#1609) 2018-12-06 23:41:44 +08:00
Jaumard
d40cbf9dbd add default timeout to calls (#1596)
add properties to send or not null values
update deps
2018-12-06 18:34:01 +08:00
William Cheng
d57009d14d Merge branch 'master' of https://github.com/OpenAPITools/openapi-generator 2018-12-06 17:22:19 +08:00
Atsushi Hanaoka
ced6e0502e [typescript] Avoid strictNullChecks errors for apiKeys (#1611)
* [typescript] Avoid strictNullChecks errors for apiKeys

fix #1607

* Run ./bin/{LANG}-petstore.sh

- ./bin/typescript-angular-petstore-all.sh
- ./bin/typescript-inversify-petstore.sh

* Run ./bin/security/{LANG}-petstore.sh

- ./bin/security/typescript-angular.sh
- ./bin/security/typescript-angular2.sh
- ./bin/security/typescript-inversify.sh

* [typescript] Fix parameter name sanitization

* Fix invalid consumes of petstore-security-test.yaml

* Run ./bin/security/typescript-*.sh
2018-12-06 17:10:45 +08:00
William Cheng
314b4cc54f
remove deprecated methods in default codegen (#1031) 2018-12-06 16:17:32 +08:00
William Cheng
21b2b20c2d Merge remote-tracking branch 'origin/4.0.x' 2018-12-06 12:21:14 +08:00
Prateek Malhotra
1e023f3b6e [Typescript][Fetch] Fix bugs with new typescript-fetch generator (#1545)
* [Typescript][Fetch] Always initialize queryParameters

* [Typescript][Fetch] Resolve date and date-time formats to parameter type Date

* [Typescript][Fetch] Update models template

- Add `readonly` modifier to readOnly parameters.
- Omit readOnly parameters from requests when serializing models
- Use allVars in models template when serializing/deserializing requests

* [Typescript][Fetch] Omit time component when parameter format: date

* [Typescript][Fetch] Add moduleResolution: node option to tsconfig.json

* [Typescript][Fetch] Added non-model enums
2018-12-06 12:20:34 +08:00
Hemant Zope
df19c13347 [C] Resolve some issues from #1473 (#1497)
* change folder structure for external and added list as primitive type

* modified gitignore for C generator

* change include statement as per directory structure

* added projectname variable for using in cmakelists

* modified cmakefile:compile files irrespective of testfiles and add support for make install

* updated readme with how to compile and how to use

* CMakeLists change curl to 7.58.0

* fix indentation

* add remove as reserved word
2018-12-06 11:39:30 +08:00
William Cheng
4be605bcb7
GraphQL Server (#1603)
* Add GraphQL express/apollo server generator

* add basic resolvers; adjust parameters/input types

* small adjustments and improvements

* adjust logger config for GraphQL generators

* remove MaxPermSize form bash script as it will be removed from later Java versions; add isNullable utility helper method; Adjust TODOs for graphql implementation

* re-created samples for graphql config and server generators

* re-added templates for graphql config generator

* add graphql-config-petstore bash script

* add isNullable utility method

* fix javadoc issues

* adjust licence headers

* rename Generator to Codegen for GraphQL classes

* renaming, minor enhancement to graphql generator

* add graphql server samples

* add windows batch files, rename directory
2018-12-05 18:20:53 +08:00
William Cheng
01ac429954
fix TS version check (#1616) 2018-12-05 18:06:55 +08:00
Philipp Kainz
10ea00066a [typescript-angular] Angular 7 compatibility of dependencies and package generator (#1613)
* added Angular v7 compatibility version support

* fix logic error

* updated petstore samples

* fixed failing tests and added Angular 7 client test app
2018-12-05 15:15:51 +08:00
Mark Thebridge
4930f75dc7 Generic JSON body support in rust-server (#1523)
* Ensure that generic JSON bodies are correctly autogenerated

Generates valid Rust for an arbitrary JSON response body of type `object` with no other schema.
2018-12-04 16:51:59 +00:00
William Cheng
8795bff35e Merge remote-tracking branch 'origin/4.0.x' 2018-12-04 23:26:52 +08:00
Fabrizio Ferrai
6976a8c775 Upgrade haskell-servant generator to latest LTS (#1469)
* [Haskell Servant] Upgrade to lts-12

- Upgrade Servant to the latest version
- Add Maybe for optional values
- Add UUID, UTCTime and Day types
- Fix the URL configuration so that it has one param with all data
- Add Data and ToSchema instances to models
- Switch to TLS http manager so it can connect to https urls
- Add nicer API to call the endpoints
- Add Nix support

* [Haskell Servant] Upgrade Petstore

* [Haskell Servant] Delete old swagger-petstore samples

* [Haskell Servant] Use generics for ToForm and FromForm instances

* [Haskell Servant] Generate ToSchema instance only if it's safe to do
2018-12-04 19:03:08 +08:00
Rubén Martínez
110d057384 [csharp] Fixed issue #1524: useDateTimeOffset not working in openapi generator 3.3.3 (#1544)
* Run ./bin/utils/ensure-up-to-date to re-generate samples run in the CI.

* Fixed issue #1524 that caused the `useDateTimeOffset` additional property for the `csharp` generator not to work.
2018-12-04 18:59:15 +08:00
Erik Timmers
d75392e056 [elm] Enable setting base path for each request (#1538) 2018-12-04 18:36:55 +08:00
Juan Eugenio Abadie
e84c59f4cc [cpp rest-sdk] Add status code to response handler (#1541)
* Add status code parameter to the response handler

* Update PetStore
2018-12-04 18:35:39 +08:00
Kiran-Sivakumar
0a33ad465f [Java][okhttp-gson] Fix bug when performing OAuth token retry (#1576)
* Fix access token retry bug

* Update petstore samples

* Remove newline

* Import Pair and List in RetryingOAuth template

* Update petstore samples

* Update petstore samples
2018-12-04 18:33:10 +08:00
Denis Korenevskiy
8ee1553654 Replace <tt> tags with <code> to make new jacadoc work. (#1585)
Replace <tt> tags with <code> to make new javadoc work.
2018-12-04 18:16:23 +08:00
Christophe Bornet
001f89f1d9 Add tests to online generator (#1591) 2018-12-04 18:14:50 +08:00
Rubén Martínez
e3ab059530 [csharp] Fix #1531 with non-nullable enums on operation parameters not compiling (#1543)
* Run ./bin/utils/ensure-up-to-date to re-generate samples run in the CI.

* Fixed issue #1531. Now in C# operation parameters are post-processed to correctly mark them as enumerations. The api.mustache C# template now marks parameters as nullable when they're non-required enums.

* #1531 Added fix for enum, non-required parameters to the interface of the auto-generated C# Apis.

* Fixed error with the development of ticket #1531, which duplicated nullable question marks for primitive types.
2018-12-03 17:28:08 +08:00
William Cheng
dfa7e616c0 Merge remote-tracking branch 'origin/master' into 4.0.x 2018-12-01 19:18:27 +08:00
William Cheng
2f4dc9a049
Prepare 3.3.4 release (#1583)
* update release version

* update doc for 3.3.4 release

* comment out stack installation due to error in travis
2018-12-01 01:00:06 +08:00
Christophe Bornet
54b5093381 Improve online gen resolution of host for the download link (#1580)
Fix #1517
2018-11-30 22:04:17 +08:00
William Cheng
cf2ddb8b8c
Fix header parameters display in the documentation (#1579)
* fix header parameters display in html

* fix cwiki header, remove test header parameter
2018-11-30 20:57:52 +08:00
William Cheng
8f8d3547f6
Update JS client dependency (#1578)
* update js dep

* fix missing comma

* remove unused test files in JS

* remove StringBooleanMap.spec.js

* remove StringBooleanMap.spec.js
2018-11-30 18:47:32 +08:00
William Cheng
b226f52d13 Merge remote-tracking branch 'origin' into 4.0.x 2018-11-30 10:16:16 +08:00
sunn
308515bbc1
[cpp-qt5] client response headers and validation of properties for client and server (#1508)
* Add validation of required properties
Add Header extraction for client
* Remove some todos
* Add Test for Store API
Improve some checks for serialization
2018-11-29 11:00:37 +01:00
Michael Ramstein
6930433def [elixir] Typespec - allow null on optional struct-attributes (#1514)
* Typespec - allow null on optional parameters

* Run Petstore for elixir

* considers 'nullable' in model template, fixes 'isRequired'
2018-11-29 15:58:32 +08:00
Akihito Nakano
f7c857cc39
[Spring] Add an option to return success code (#1197)
* Returns status code which defined at Response Object

* Tweak indent

Remove the spacer "{{#async}} ... {{/async}}" "{{^async}} ... {{/async}}"

* Update samples^

* Fix broken indentation

* Update samples

* Revert methodBody.mustache

* Revert "Fix broken indentation"
  * This reverts commit 95b6a00f8b1d92a65e0d4467b5c4f034a9579e43.
* Revert "Tweak indent"
  * This reverts commit ba2cedc89723ed480e8282c0a4e07ab2d3670262.
* Revert "Returns status code which defined at Response Object"
  * This reverts commit f676a89e230dde6741aa96d7b2e27e04b35dbf5a.

* Example contains status code

* Update samples

./bin/spring-all-pestore.sh

* Fix syntax error

* Update samples

* Run bin/utils/ensure-up-to-date

* Make the changes an option `returnSuccessCode`

* Run bin/spring-all-pestore.sh to update samples

* Run ./bin/utils/export_docs_generators.sh
2018-11-29 11:51:25 +09:00
Simas Abramovas
777bf1f3aa Kotlin collection type (#1564)
* Allow specifying type

* Add test

* Update docs

* Don't modify types if the default option is chosen
2018-11-29 10:33:55 +08:00
William Cheng
c63f58f1ef
[Elixir] fix ":body" handling (#1504)
* Fix swagger-api/swagger-codegen/issues/8138 swagger-api/swagger-codegen#8138

When JSON payload needs to be in the body (`"in": "body"`), it must not generate a multi-part body, but embed directly in HTTP body.

* update elixir samples

* update elixir client samples

* remove double quote
2018-11-28 21:35:50 +08:00
Kiran-Sivakumar
9df70798b3 [Java][okhttp-gson] Add option to employ builders for API requests (#1341)
* Generate APIs that use the builder pattern

* Add option to use builders for API requests

* Fix template spacing

* Add new sample-generation script and generated samples

* Update docs

* Add new sample-generation script for Windows

* Replace config option with vendor extension

* Remove useBuildersForApiRequests config option

* Remove builders sample-generation scripts

* Replace config option with vendor extension in api_test template

* Remove okhttp-gson-requestBuilders sample

* Rename x-builders-for-api-requests to x-group-parameters

* Add modified api_doc.mustache under okhttp-gson resources

* Add modified README.mustache under okhttp-gson resources

* Update petstore samples

* Fix FakeApiTest.java in petstore samples

* Add whitespace to rerun checks

* Remove whitespace to rerun tests

* Fix FakeApiTest.java in parcelable petstore sample

* Update versions in samples

* Update versions in samples
2018-11-28 17:53:36 +08:00
Akihito Nakano
3efe56752e Improve error message when the spec is not found (#1495)
* Improve error message when spec not found

* Add test yaml

* Fix invalid yaml file path

* Fix typo
2018-11-28 16:50:52 +08:00
rasmusfaber
d8dde6855f Use checksum to decided if input spec has changed. (#1502) 2018-11-28 16:43:00 +08:00
meganemura
ebf67e683c Fix regexp in ruby-client (#1521)
* Fix regexp in ruby-client

* Remove tests for unknown regexp patterns
2018-11-28 16:40:58 +08:00
feihongmeilian
5b4a19849e Upgrade the erlang-server dependency from cowboy1.x to cowboy2.x (#1364)
* Upgrade the erlang-server dependency from cowboy1.x to cowboy2.x

* Update erlang-server sample

* Fix a bug for erlang-server test
2018-11-28 11:50:08 +08:00
William Cheng
9b99b6b6bf
better hanlding of string type with different format (#1558) 2018-11-28 11:21:54 +08:00
Michael Ramstein
d31fa4f7c4 Typespec: Fixes issue with formated primitivs (#1534) 2018-11-27 21:34:54 +08:00
Michael Ramstein
247bd68880 Decodes list with primitvs (#1536) 2018-11-27 17:00:10 +08:00
Michael Ramstein
4eae430cca [elixir] Fixes BadMapError for header parameters (#1537)
* Adds :headers as expected param mapping

* Gen Petstore
2018-11-27 16:59:16 +08:00
Erik Timmers
172448fa28 Add support for UUIDs (#1516)
And fix naming for `decode` functions.
2018-11-27 13:47:06 +08:00
William Cheng
46a4ffe64c
Skip model generation if it's a top-level map or array (#1296)
* update samples

* remove string boolean map spec

* add logic to skip array alias being generated as model

* fix alias to array

* remove unused ruby files

* remove unused ruby (oas3) files

* unalias response schema

* fix NPE when no model defined

* fix ruby openapi3 script

* update samples

* add global openapi, schemas for unaliasing

* minor code cleanup/refactoring using globalSchemas

* Revert "minor code cleanup/refactoring using globalSchemas"

This reverts commit 20a2bbc6fc4267a0e0768dcf5f15d4194ce9647b.
2018-11-26 22:01:53 +08:00
Yuichi Okada
ce0253892c [PHP client] Fix README.md template for php (#1540)
* Fix README.md template for php

* update php openapi3 samples
2018-11-26 13:41:27 +08:00
Akihito Nakano
34abedeb8a
[PHP] Bump minimum required version to PHP7.1 (#1491)
* Bump minimum required version to PHP7.1

ref: http://php.net/supported-versions.php

* Bump phpunit

* Update [api|model]_test.mustache

* Update samples

bin/openapi3/php-petstore.sh

* Update namespace of PHPUnit ("tests" folder)

* `setExpectedException` is deleted in PHPUnit 7.4

* Update namespace of "Assert" class

* The attribute 'name' is required

* Add anotation to exclude the test from risky testcheck

* Update samples (samples/client/petstore/php)

* Apply updates to "test" in openapi2 folder (samples/client/petstore/php)

b3495ecbfe
15e00ae89d
2fc6917d13
0d016c00ed

* Install php7.1

* Switch to php7

* Update samples (security)

bin/security/php-petstore.sh
2018-11-26 08:59:22 +07:00
William Cheng
7db12aa4af Merge remote-tracking branch 'origin' into 4.0.x 2018-11-24 17:48:17 +08:00
William Cheng
bf2932d41c
fix array of enum class in JS (#1484) 2018-11-24 17:04:59 +08:00
William Cheng
f8ada391c4
Fix boolean value handling in HTTP request body (#1515)
* fix boolean http body handling

* fix typo in parameter name
2018-11-24 16:42:32 +08:00
Christian Schneider
0ba9278308 #1506 Bump Zone.js to remove warnings when using angular >=6. (#1522)
* 1506 allow zonejs 0.7.x and 0.8.x to support a wider range of angular versions

* #1506 Removed zone.js as peer since it comes with angular itself

* #1506 Removed zone.js as peer since it comes with angular itself
2018-11-24 16:42:09 +08:00
Erik Timmers
e91d6d735d
[elm] Add support for nested Lists & Dicts (#1528)
And rename Union Types to Custom Types and Aliases to Records.
2018-11-23 16:03:07 +01:00
Erik Timmers
5f1362daad
Update Elm for elm/http 2.0.0 (#1510) 2018-11-23 16:02:55 +01:00
Juan Eugenio Abadie
dd33434064 [cpp rest-sdk] Reponse headers handler (#1511)
* Add support to set a Response headers handler
* Update PetStore
* Fix missing names
* Update PetStore
2018-11-23 11:38:40 +01:00
William Cheng
cf04ba30db
Fix the function name starting with numbers (#1513)
* update elixir samples

* fix function name starting with numbers

* add new files
2018-11-23 17:32:51 +08:00
William Cheng
5aa1da7c2e
Add utility methods for free-form objects (isFreeFormObject) (#1338)
* add utility methods for models

* add isFreeFormObject tag

* add object mapping for elixir client

* minor fix to free form object check
2018-11-22 18:46:09 +08:00
Jon Schoning
9be5b99266 [haskell-http-client] fix typename generation bug for array params; update deps
- fix build for example-app + tests-integration in Samples (due to change in Category)

  - upgrade stack to 12.18

  - fix typename generation bug for array params
2018-11-20 18:38:07 -06:00
Alwin Garside
792f95eb09 [PHP] Use appDescription in composer.mustache (#1485)
* Use appDescription in composer.mustache

* Update petstore files

* More updated php petstore files

* Yet another updated php petstore file

* Use "{{{appDescription}}}" instead of "{{appDescription}}"
2018-11-20 10:30:14 +09:00
William Cheng
2b58f6737a
fix typo in java client docstring (#1494) 2018-11-19 21:14:03 +08:00
William Cheng
363b095721
better warning, default value (#1492) 2018-11-19 20:55:29 +08:00
William Cheng
f58bd6d839
fix NPE for scala gatling generator (#1479) 2018-11-19 11:06:16 +08:00
William Cheng
0e693cd9a8
Fix NPE with cpp-restsdk client generator (#1477)
* fix_cpprest_npe

* fix_code_format
2018-11-19 11:05:44 +08:00
William Cheng
65a86eee3b Merge remote-tracking branch 'origin/master' into 4.0.x 2018-11-18 18:54:29 +08:00
PLACE
334415dec2 Typescript fetch fork (#569)
* added my fork from https://github.com/Place1/swagger-codegen-typescript-browser

* ran bin/typescript-fetch-petstore-all.sh

* use FormData.append rather than .set for IE11 compat

* reverted change to licenseInfo.mustache

* reverted some comments

* added package.json and tsconfig.json back to the generator

* added support for blob (application/octet-stream) responses

* models and apis are now in folders

* added support for modelPropertyNaming based on the spec

* bug fix

* updated samples

* Restore pom.xml for typescript project

* Restore samples/client/petstore/typescript-fetch/tests/default/package.json
≈

* added support for response type Date conversion

* updated samples

* Rework pom in "samples.ci"

* Restore "samples/client/petstore/typescript-fetch/tests/default"

* updated configuration class to use property getters to allow clients to implement configuration values as getters

* added {{datatype}}ToJSON functions to handle serialization and naming conversions

* fixed missing import

* fixed compilation error. updated samples

* 1 character change to get CI to run again

* updated samples

* added support for array type request body

* updated tests

* support for optional request bodies

* updated models json converters to handle undefined inputs (to simplify usage in optional contexts like optional request bodies)

* updated samples

* updated tests

* changed to typescript version 2.4

* updated samples

* support for optional properties being null, undefined or omitted

* updated samples

* bug fix

* bug fix

* updated samples

* ran npm install in test project

* patch to get tests running

* added support for retrieving raw response. added support for binary request bodies. added support for blob data type for files/binary.
2018-11-18 13:24:24 +08:00
Ludovic Montel
7f8ff35245 fix #1272 Fix wrong PHP Symfony typehint (#1453)
A model with an array property used to have the wrong PHP typehint in
the setter: the array item object type instead of "array"
2018-11-18 12:38:44 +08:00
William Cheng
941b3ea015 fix NPE in the C# Nancy generator (#1478) 2018-11-17 10:11:14 -05:00
William Cheng
edc05df774
Add C client generator (#516)
* add c generator (1st commit)

* udpate c model template

* more fixes

* Add string replace function for C generator (#908)

* Add string replace function for C generator

* Fixed replacement for variable only

* Fixed problem for different datatypes of paramName

* store return value of modified path

* set str_replace variable to be same as original variable.

* [C] Fixed coding style issues

* add uncrustify support

* update petstore sampmles

* add Locale.ROOT

* added test-api-client.c to include test cases for strReplace function

* added header and body mustache and made changes to ClibcurlClientCodegen.java accordingly

* [C] renamed functions in apiKey.c.mustache according to apiKey.h.mustache

* [C] changes in import statement

* renamed apiKey.h to keyValuePair.h and made necessary changes in the codes

* changed apiKey.c according to keyValuePair.h

* fixed import statement in model

* added code for generating struct in model-header.mustache

* added typedef struct for model-headers

* updated sample/client/petstore/C

* fix locale

* [C] Function addition and modification of major structs (#1020)

* added readme file

* fixed parameters in api headers functions

* made changes to add readme file and typemapping of array to list

* fixed header import statement in apiheader files

* modified struct of model type in model header

* updated sample

* modified README file

* updated sample

* parse from json function added

* modified struct and create function

* added include for model

* modified parsefromjson function

* modified struct and create function for more datatypes

* added mapping for date-time and modified model import return statement

* modified function parameters

* modified include statement

* fix function in api body

* updated sample

* clean up files

* regenerate c petstore

* fix error message when setting uncrustify

* add version to uncrustify usage

* added uncrustify rules in  mustache (#1021)

* added uncrustify rules in  mustache

* updated sample

* updated same with crustify

* updated sample with uncrusitfy 0.67

* modified readme about uncrustify requirements

* fixed mistakes in readme mustache and sample readme

* fix file import, unformat c petstore

* fix import in test files

* fix model with complexType

* fix free string, format the code using uncrustify

* modified sample

* Modified sample to check

* return type issue figured,more to do to fix it

* minor fixes to make complete code compile

* Compiling sample code. Store has issue with map.

* comment out test file generation which is not req.

* commented operation name

* fixed various issues responsible for code not compiling

* test mustache temporary for testing

* updated sample add,del,getbyid works, formparam yet to do

* few minor changes and added fuction to add different header and content type in apiClient

* added code to upload image

* added function to test upload image

* fixes for fileupload and various other small things

* fixed issue due to xml produces

* updated sample:working sample add,del,find,uploading:tocheck ,

* added free functions for variable where memory is allocated

* rename imagecontainer struct to filestruct

* fix issues with if functions for all list types

* fixed issue with primitive return type in header file

* updated sample w/ free functions

* update c samples

* remove corrupted file

* update samples

* test cases for APIs

* added function to generate test cases from new mustache

* mustache files for manual written test cases

* added default content type to application/json

* fixed issue with primitive return type

* fixed issue with bool type

* added file apiKey.c

* updated sample tested

* update c environment variable (#1090)

* add mapping for map (#1103)

* minor update

* revert list paramter check to NULL

* modified return type for primitive(map - list_t)in mustache

* removed apiClient_free as it was two times

* updated sample

* fixed issue of path parameter when string less than parameter len

* fixed issue for form paramters upload

* added checks to avoid seg faults

* updated sample

* added check for null value in form parameter

* modified size of mallocs to dynamic

* updated sample

* Add C Petstore to Travis CI (#1136)

* setup CI for C petstore

* update bash script permission

* unit petapi test

* fixed memory leak in strReplace and apiClient Functions

* modified return value for status generation

* added enum defination and functions to convert and back from string

* added function for enum and made changes to free memory at necessary places

* added datatype handling for enum

* fixes regarding memory allocation and free

* updated mustache of test files

* updated sample

* renamed manually written test files

* manual test file for pet

* cleaned common api test file for time being

* renamed test files

* added renamed test files to build test bash

* added file null pointer check

* modified uncrusitfy rules

* minor update to c templates (#1161)

* [C] Fixed enum function declaration  (#1178)

* fixed enum function declaration in model headers

* fixed enum declaration in header files for sample

* disable curl verbose mode and add response code variable

* added response code variable in apiClient struct

* modified apiClient header and source file

* added response and removed commented code api-body mustache

* removed commented code from model-body mustache

* removed unnecessary print statements from test mustache

* updated sample

* fixed spaces issue

* Better format in C templates (#1224)

* better format in the c template

* minor format fix

* [C] changed base url from static to dynamic (#1225)

* changed basePath from static to dynamic

* removed unnecessary header declaration

* updated sample

* [C] added curl version check in CMakeList.txt (#1248)

* added curl version check in CMakeList.txt

* Updated README for latest curl version

* [C] Major changes to keyValuePair function (#1282)

* removed static declaration

* changed static declaration

* added difference for string and non string

* added more code for different function for string and non string

* fix issue with param name

* change value in keyPairValue to void

* fixed issue of difference in function name cases

* added support for non char parameters in api

* fix issue of map return data

* modified manual-StoreAPI map return data handling

* fix minor mistake

* added support for map and changed code to support value of keyvaluepair as char and other

* updated sample

* fixed api header declarations

* change map declaration in header

* resolved issues realted to map data handling

* fix minor issues

* add N at start if enum variable starts with number

* override toParamName method

* changed paramters to paramName from baseName

* change variables in apibody from baseName to paramName

* Skip test file generation (#1459)

* skip test file generation

* skip overwriting CMakeLists.txt
2018-11-17 01:32:18 +08:00
Benjamin Gill
32b8d7fee7
[rust-server] Always derive Debug (#1404)
* Add test for file response

* Always derive Debug

Now that we're using a byte array, we can guarantee that deriving Debug will always work
2018-11-16 12:28:05 +00:00
Shengpeng Liu
dc3a3dd15a Fix openapi_types generation error (#1256) 2018-11-15 21:38:45 +08:00
William Cheng
2bcf5b2263 Merge remote-tracking branch 'origin/3.4.x' into 4.0.x 2018-11-15 17:49:44 +08:00
William Cheng
a87a544bf5 Merge remote-tracking branch 'origin/master' into 3.4.x 2018-11-15 17:11:01 +08:00
William Cheng
8d9542207a
Prepare 3.3.4 snapshot (#1450)
* change version to 3.3.4-snapshot

* updat readme

* update samples
2018-11-15 16:21:15 +08:00
James Addyman
653601bef2 Fix #1424 [SWIFT4] Date Encoding Issues (#1442)
Ensure the same date format string is used throughout the generated code (use the one set in Configuration.swift).

Ensure the same date formatter options are used when encoding dates as well as decoding dates. If a consumer has set their own date formatter on CodableHelper, use that when encoding dates too.

Adds DateFormatTests to the SWIFT4 unit tests.

Updates the SWIFT4 petstore samples
2018-11-15 11:20:39 +09:00
William Cheng
7564d629e7
prepare 3.3.3 release (#1447) 2018-11-14 23:56:58 +08:00
William Cheng
f647b2f24b
Add file post-processing to C++ client, server generators (#1440)
* add file post processing to cpp generators

* use clang to auto format cpp-restsdk code

* restore cpp-restsdk samples without clang format
2018-11-14 16:43:14 +08:00
William Cheng
0165b0fb33
test all generators with fake petstore spec 2.0, 3.0 (#1439) 2018-11-14 15:55:09 +08:00
Jim Schubert
df1819daa9 C# template refactor (#737)
* [csharp] Refactor to support third-party customization more easily

* [csharp] Regenerate OpenAPIClient sample

* create new csharp-refactor client gen

* update samples

* fix Locale.ROOT

* fix import

* remove outdated files, update samples
2018-11-14 14:41:42 +08:00
William Cheng
3c28946f1e
[Android] Fix compilation errors when there's no model defined (#1438)
* remove model import when there is no model

* fix android http client no model issu due to import
2018-11-14 14:02:05 +08:00
TNM Technologies
22902e72a1 fix(#1423): [JAVA] generating Map with jaxrs-reasteasy does not import (#1426)
* fix(#1423): [JAVA] generating Map with jaxrs-reasteasy does not import
the hashmap

https://github.com/OpenAPITools/openapi-generator/issues/1423

* fix(#1423): fix ensure-up-to-date issues for jaxrs-resteasy joda
samples

https://github.com/OpenAPITools/openapi-generator/issues/1423
2018-11-14 10:18:53 +08:00
William Cheng
efde4a8eb8
Fix issue with C# generator when the model name is "File" (#1428)
* fix get schema type in abstract c# class

* update c# petstore sample
2018-11-14 09:43:31 +08:00
Akihito Nakano
c8837ea414
Change entrypoint to docker-entrypoint.sh (#1413)
Run entrypoint script
2018-11-13 17:24:04 +09:00
William Cheng
7e3149e675
fix npe when paramName is null (#1416) 2018-11-12 22:06:58 +08:00
meganemura
9db62f459a Fix return_type parameter examples in ruby-client (#1399)
* Fix return_type parameter examples

* $ bin/openapi3/ruby-client-petstore.sh
2018-11-12 14:26:05 +08:00
William Cheng
c7349c7f88
Add top level x-group-parameters support (#1405)
* add top level x-group-parameters support

* update petstore samples
2018-11-12 14:25:32 +08:00
William Cheng
7ce38aae38
Remove duplicated imports (#1414)
* remove duplicated imports

* fix model import in java

* update generator docs

* fix model import for retrofit2 client
2018-11-11 21:33:28 +08:00
sunn
fd46b4e566
Sanitize Model Import (#1411) 2018-11-10 21:07:49 +01:00
James Addyman
5711985ac3 Fix swift4 1406 (#1407)
* Fix warnings produced when using Swift 4.2

* Update Petstore client for Swift 4
2018-11-10 13:59:58 +09:00
sunn
8ba4b3a276
Sanitize names in case number is present (#1409) 2018-11-09 16:53:30 +01:00
Simas Abramovas
f802e63f9f Add parcelizeModels cli option (#1289)
* Add parcelizeModels cli option

* Add info log to clarify the parcelization requirements.

* Update docs
2018-11-09 23:51:27 +08:00
sunn
0ed02c8e91
Fixes double prefixing during model import (#1398) 2018-11-09 16:49:47 +01:00
Eivind Bergstøl
93e2fc6355 Fixes an issue where code generator for Java produces not compileable (#1357)
code if the yml-definition does not have any type definitions. This
is normal if the api only uses simple datatypes (Int, String) for
inout/output.
2018-11-09 23:48:26 +08:00
William Cheng
60bc19e830
Add file post-processing to PHP generators (#1402)
* add file post processing to php

* restore php petstore client
2018-11-09 23:45:21 +08:00
William Cheng
d59230fd27
change python pool_thread default to 1 (#1403) 2018-11-09 23:44:47 +08:00
Benjamin Gill
4742f0086b
[rust-server] Re-instate ApiRequestParser (#1388)
* Re-instate ApiRequestParser

It turns out I was over-eager when removing file support and accidentally deleted some code that should have been kept. See https://github.com/OpenAPITools/openapi-generator/pull/547/files#diff-684007b298ee5998fa30732c261ea2fcL469.

* Don't do html escaping of parameters
2018-11-09 11:23:59 +00:00
sunn
75b1403c1e
[cpp-qt5] improvements for server and client (#1284)
- Remove pointer usage in generated models
- Use const reference wherever possible
- Reuse same super class for Qt5 client and server
- Support primitive return types for Qt5 client
- Add const reference to API calls
2018-11-08 14:18:57 +01:00
William Cheng
e6c97a1bc1 Merge remote-tracking branch 'origin/3.4.x' into 4.0.x 2018-11-08 18:18:12 +08:00