Commit Graph

7049 Commits

Author SHA1 Message Date
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
William Cheng
a186efed35 Merge remote-tracking branch 'origin/master' into 3.4.x 2018-11-08 18:17:29 +08:00
William Cheng
3969afb2ff
Add file post-processing to Kotlin generators (#1400)
* add post processing to kotlin file

* restore kotlin samples
2018-11-08 17:40:39 +08:00
William Cheng
2ef499faf3
[python] Avoid creating unused ThreadPools (#1387)
* Avoid creating unused ThreadPools

Instead, create ApiClient.pool on first request for .pool property.

avoids spawning n-cpus threads (the default for ThreadPool) at instantiation of every ApiClient

* update doc

* set pool_thread to None
2018-11-08 17:39:20 +08:00
William Cheng
34945427d4
fix java exception in apex codegen (#1395) 2018-11-07 22:32:22 +08:00
Benjamin Gill
5849dbaaca
Add tests for inline objects (#1331)
I think these tests cover all the problems with rust-server and inline objects I know about. This should show us when we've fixed the problem.

Also fixes a CI failure.
2018-11-07 11:07:53 +00:00
Steven Masala
73162cbcca fix name sanitation when using kebab case filenaming (#1314)
* fix name sanitation when using kebab case filenaming

* remove whitespaces
2018-11-07 15:52:51 +08:00
Guy Gershoni
0e2e1bf715 Added tests and fix for issue #1392. Fix regex generated in Ruby client. (#1393)
* Added tests and fix for issue #1392. Param validation with regex not recognizing \d correctly in Ruby client.

* Added generated files to pass ./bin/utils/ensure-up-to-date which is run by circleci
2018-11-07 12:08:23 +08:00
Konstantin Pavlov
301208a785 JavaSpring: pojo: fix javadoc comment (#1384) 2018-11-07 11:26:56 +08:00
Christophe Bornet
2184a8a9b4 [Flask] Upgrade to flask-connexion 2.0.0 (#1382)
Fix #323
2018-11-06 18:37:50 +08:00
Benjamin Gill
30bfebfa16
Rust server html (#1329)
Builds on #1180 by @colelawrence. This addition to the rust-server generator enables the use of text/html responses as plaintext.

I've added an html endpoint to the sample to demonstrate that this works (and fixed the problem that that uncovered).
2018-11-05 16:14:23 +00:00
Martin Fidczuk
303b469fae Allow package version to be passed on CLI (Rust fix) (#1286)
This MR allows package version to be specified in Rust in the generate argument list, with the argument `-DpackageVersion=<package_version>`. If this argument is present then the version in the resulting Cargo.toml file will be the passed value. If this argument is not present then the version in the OpenAPI definition file will be used, as per current behavior.
2018-11-05 16:12:43 +00:00
William Cheng
c95b1f4545
fix incorrect patternin aspnetcore (#1371) 2018-11-05 10:21:55 +08:00
Nathan Broadbent
63b1c233c9 Fix issue with Ruby client where strings from example properties are not wrapped with quotes (#987) 2018-11-04 17:10:35 +08:00
andreas-eternach
eb5a8cc752 feat: OpenApi-generation from within eclipse (#509) (#1332)
* feat: OpenApi-generation from within eclipse (#509)

* Added life-cycle-mapping for recognition by M2E
* Make BuildContext injectable by M2E in oder to detect if json-source
has been modified and a regeneration is required.

* core: fix indentation problems, remove commented code
2018-11-04 17:07:33 +08:00
Benoît Courtine
293d29ab3b Fixes bug #1339. Array and Map inner schema can be missing. In this case, it must default to String. (#1363) 2018-11-03 22:19:19 +08:00
Kiran-Sivakumar
078b04deac [Java][okhttp-gson] Add new ApiClient constructors for access token retry (#1319)
* Add new ApiClient constructors for access token retry

* Update samples

* Update security samples
2018-11-03 22:10:16 +08:00
Vasili Puchko
ac6fd3f79f Update gradle plugin's Readme.md (#1356)
Add a note about use of `systemProperties` since some options are confusing and hard to guess how to use correctly. The only source I was able to find how to configure it in the way I need was a comment to issue https://github.com/OpenAPITools/openapi-generator/issues/551#issuecomment-411686091
2018-11-03 21:58:43 +08:00
sunn
f8f3a08282
[cpp-pistache]Add support for map (#1359)
* Add support for map
* Add support for nested maps
* Simplify Array and Map Helper
* Use const reference wherever possible
2018-11-03 14:09:31 +01:00
Juan Eugenio Abadie
ecff8b5d00 [cpp rest-sdk]Fix precision (#1293)
* Convert floating point numbers to string with higher precision
* Update PetStore
2018-11-01 20:25:38 +01:00
Ysawa
521f5fafa3 Fix defaultValue for String schama in Dart (#1342) 2018-11-01 17:50:01 +08:00
William Cheng
02e85cc417
Prepare v3.3.3-SNAPSHOT (#1355)
* prepare 3.3.3-snapshot

* update petstore samples
2018-11-01 10:42:26 +08:00
William Cheng
0cc9b69b6f
3.3.2 release (#1353)
* prepare 3.3.2 release

* update script to remove outdated reference
2018-10-31 20:48:14 +08:00
Dennis Kieselhorst
30474c7867 update CXF and Jackson to latest version (#1343) 2018-10-31 16:45:51 +08:00
William Cheng
aced89ff8b
Add group parameter support to PHP client (#1337)
* add group parameter support to php template

* more update for group parameter

* fix call to protect function

* fix missing $

* update based on feedback

* create fake endpoint to test group parameters

* sync fake petstore spec v2, v3

* fix php doc for group parameters

* update petstore samples

* update fake petstore spec v2

* update petstore samples

* fix spec and update samples
2018-10-29 15:42:32 +08:00
Juan Eugenio Abadie
d80f3a6197 [cpp rest-sdk] Constness (#1295)
* Improve method signatures to use const when the value won't change

* Update PetStore

* Change setters for non-primitive types to receive const reference parameters

* Update PetStore
2018-10-28 08:01:52 +01:00
micw523
107467497c Fix W605 Warning and reenable flake8 (#1334) 2018-10-28 11:16:54 +08:00
William Cheng
d7d5e712e2
test jdk10, fix javadoc issue (#1335) 2018-10-27 18:54:16 +08:00
Juan Facorro
fc0a0d2cda Generator erlang-proper (#1102)
* Generator erlang-proper

Used to generate PropEr generators for property-based testing

* Fix binary/2 implementation. Add behaviour attribute.

* Remove line from copyright notice

* Avoid escpaing HTML and remove suffix from variable name

* Update samples

* Include querystring parameters

* We use export_all, don't consider warnings as errors

* List command sequence on failure

* Use hasConsumes instead

* Add nowarn_export_all, re-add warning_as_errors
2018-10-27 16:54:35 +08:00
Dennis Kieselhorst
a6b0a8b4b7 removed unused import to fix build (#1326) 2018-10-27 15:01:59 +08:00
topce
0a45890709 Fix angular 7 compile problem (#1297)
* fix wrong formParams type

* run typescript-angular-petstore-all.bat

* more typesafe fix

* fix formatting

* run typescript-angular-petstore-all.bat

* fix compile  problem with previous versions of angular

* generate code

* fix compile problem add <any>

* try Johannes Hoppe solution

* generate files
2018-10-27 14:27:52 +08:00
William Cheng
3482a0a993 Merge remote-tracking branch 'origin/master' into 3.4.x 2018-10-26 21:04:25 +08:00
William Cheng
4a47acce19 Merge remote-tracking branch 'origin/3.4.x' into 4.0.x 2018-10-26 18:41:58 +08:00
William Cheng
9422dea149 Merge remote-tracking branch 'origin/master' into 3.4.x 2018-10-26 18:40:37 +08:00
William Cheng
3b53ac435f
fix duplicate call in JS (#1270) 2018-10-26 18:28:37 +08:00
Erik Timmers
1b115bb4f7 [elm] Add flag to prefix custom type variants (#1288) 2018-10-26 18:20:36 +08:00
Yuriy Belenko
30062afc7c [Slim] Migration to PHP7 (#1263)
* [Slim] Add PHP 7.0 to requirements

* [Slim] Migrate to PHPUnit 6

* [Slim] Update user guide

* [Slim] Refresh samples
2018-10-26 18:15:41 +08:00
John Wang
ed8433a849 [Golang][client] fix response decode error handling (#1291)
* handle and return API response decode error

* ensure-up-to-date

* refactor go/api.mustache for easier readability

* disable error reporting for TestPlaceOrder with invalid RFC 3339 `+0000` UTC offset present in Petstore test server
2018-10-26 18:10:59 +08:00
Benoît Courtine
f4eb96933a [Rust] Client library choice between hyper and reqwest (#1258)
* Port of PR https://github.com/swagger-api/swagger-codegen/pull/8804.

* Correction of conflict with PR #528 (missing template file).

* Add rust-reqwest samples to Circle CI tests.

* Add integration test pom.xml file with launcher to trigger cargo execution.

* Deduplicate Maven project name.

* Fix "api_key" header for Petstore.

* Better API key management.

* Fix query param for lists of objects other than strings (numbers, etc.).

* Update to reqwest 0.9, and refactor of header management (using reqwest transition feature).

* Merge scripts generating rust-hyper and rust-reqwest samples.

* Consistent full stops.

* Use raw variables in all Rust mustache templates.

* Replace production build in CI with a quick simple check.

* Update samples.

* Finish Reqwest 0.9 migration (removing "hyper 0.11" transition feature).

* Configuration implements Default trait.

* API template reorganized: HashMap is not required anymore.

* Revert "Merge scripts generating rust-hyper and rust-reqwest samples."

This reverts commit 970f996566a740045f2a986fd70fc70f11952925.

* Remove deprecated "-XX:MaxPermSize" java arg.
2018-10-26 10:24:14 +01:00
Fabrizio Ferrai
bbfaa90242 [Clojure] Fix tests: stop dashizing props names (#1310)
* [Clojure] Fix tests: stop dashizing props names

* [Clojure] Remove jdk7 tests
2018-10-25 12:19:52 +08:00
Yuen-Kuei Hsueh
d4a5cd05cc [Java][Spring] Add bean vaildation for email datatype (#1115) 2018-10-25 11:50:12 +08:00
feihongmeilian
24ea88495b For erlang-server. add two options: packageName and openAPISpecName (#1303)
* Implement the ability to read packageName and openAPISpecName from a json file

* Replace '{{openAPISpecName}}' with '{{{openAPISpecName}}}'

* Update erlang-petstore-server
2018-10-24 16:29:53 +08:00
William Cheng
76aedca6b2
Update test spec to use "localhost" instead (#1300)
* update test spec to use localhost intead

* add new files
2018-10-24 13:56:39 +08:00
Nate Jensen
b36b4611de fix #1276 by adding colon (#1301) 2018-10-24 11:50:17 +08:00
Thibault Duperron
0aec7728f9 [Java][jaxrs-resteasy] add @Valid when bean validation is enabled (#1237) 2018-10-23 23:58:03 +08:00
mwoodland
258de8909d Add support for using Spring HATEOAS to add links in the spring gener… (#1130)
* Add support for using Spring HATEOAS to add links in the spring generator.

* Ensure that Spring HATEOAS links appear last in the JSON serialisation of objects.

* A couple of changes following code review:
1. Make sure the @JsonPropertyOrder annotation is only used when the jackson library is being used since it's a part of the jackson library.
2. Make sure to include the Spring HATEOAS dependency in the pom file for the spring-cloud and spring-mvc generators when the hateoas option is enabled.

* Don't order the json properties since there's no requirement for the links to be last.

* Remove unnecessary import.
2018-10-23 22:56:03 +08:00
William Cheng
4a0bc8f177 Merge branch 'Rizzen-ctor-without-parameters' 2018-10-23 21:50:43 +08:00
William Cheng
1418860c3a Merge branch 'ctor-without-parameters' of https://github.com/Rizzen/openapi-generator into Rizzen-ctor-without-parameters 2018-10-23 21:12:03 +08:00
William Cheng
0001682a08
Add file post-processing support for Java generators (#1052)
* add clang format support for java

* rename java env variable

* fix export command
2018-10-23 16:59:32 +08:00
Erik Timmers
e782001eb9 [elm] Add support for additionalProperties (#1262)
Fixes #1140.
2018-10-23 16:58:33 +08:00
john lilley
e06665f368 Set isModel property (#1275)
* Set isModel property

* Replace tab characters
2018-10-23 16:52:36 +08:00
Dec12 | Fujigon
bb056ccf3d [General] fix InlineModelResolver's logic and use openapi-generator's InlineModelResolver, so that nested "required" works correctly (#1200)
* fix InlineModelResolver's logis and use openapi-generator's InlineModelResolver, so that nested "required" works correctly

* add "required" to nested model schema

* update ensure-up-to-date to include openapi v3's jaxrs

* change test required field

* fix sample shell script, hide timestamp

* fix NPE

* move test case to petstore-with-fake-endpoints-models-for-testing.yaml

* fix jaxrs-jersey (oas3) example generate shell script to use petstore-with-fake-endpoints-models-for-testing.yaml

* add default value

* re-generate samples
2018-10-23 16:51:55 +08:00
Sebastian Rühl
51d2e4bd4c [TypeScript] typescript-axios: Added possibility to add custom axios instance. (#1274)
* typescript-axios: Added possibility to add custom axios instance.
This comes in handy if you want to use mocks in tests.

* typescript-axios: aligned to fetch API for custom instance
2018-10-23 16:42:10 +08:00
William Cheng
111a3626b2
update scala akka dependencies (#1294) 2018-10-23 16:34:27 +08:00
William Cheng
a55533c178
Add "servers" support to Ruby API client (#1280)
* update ruby samples with OAS3 spec

* add server support to ruby api client

* minor format change

* minor format fix, skip form models

* better exception and add test for invaid value

* remove exception test code
2018-10-22 12:52:52 +08:00
raghuraman1
2b88a1d26f Boolean conversion for maven plugin (#1252)
* saving the fixes.
Used commons-configuration2 for
org.apache.commons.configuration2.PropertiesConfiguration.
It makes the configuration easier to read amongst other benefits

* removing tabs

* updating and simplifying based on sugegstion from William. This should
now fix across all generators

* upgraded pom

* added some javadocs for the new method
2018-10-21 22:24:17 +08:00
moreginger
33a1ac4397 Don't generate unused ApiException class for java/webclient. (#1165) 2018-10-21 22:01:47 +08:00
William Cheng
f1d4ae230e
Remove outdated comment (#1268) 2018-10-21 21:39:26 +08:00
sunn
0853b2d31d
Add ref support inside fromProperty (#1235) 2018-10-20 13:52:46 +02:00
sunn
e32b70d579
Allow all apis under a single endpoint to be hosted in one server (#1230) 2018-10-20 13:50:09 +02:00
Akihito Nakano
27fd224828 [CLI] Fix help command (#1279)
* Bump up airline

* Since airline 0.8, "ParserUtil.createInstance" requires CommandFactory
2018-10-20 15:06:55 +08:00
William Cheng
0326558f9a
update spring core version (#1265) 2018-10-19 00:21:40 +08:00
Jérémie Bresson
16f1fc0739
Consider callbacks in unused schemas (#1232) 2018-10-18 14:58:28 +02:00
William Cheng
c1afba7194
Fix jackson-databind security issue (#1259)
* fix jackson databind security issue

* fix java jersey 1 dependency

* fix java webclient dep
2018-10-18 16:29:38 +08:00
tca-ms
eccab2c025 Better context errors (#1198)
Update to version 2 of the `swagger` crate, which contains changes intended to make it easier to debug errors involving middleware and contexts. Crates making use of the autogenerated libraries to also update their swagger dependency to version 2. See [here](https://github.com/Metaswitch/swagger-rs/blob/2.0.0/CHANGELOG.md) for details.
2018-10-17 17:14:43 +01:00
William Cheng
a3dc5ecc20 Merge remote-tracking branch 'origin/master' into 3.4.x 2018-10-17 00:05:47 +08:00
William Cheng
83c55ec016 Merge remote-tracking branch 'origin/3.3.x' into 4.0.x 2018-10-16 23:42:29 +08:00
William Cheng
d8957af76b
Update generator option (#1236)
* update generator option

* update kotlin option usage

* update lua option

* update wording for lua option
2018-10-16 23:05:14 +08:00
William Cheng
ebc2700a92
update gradle download link (#1254) 2018-10-16 23:04:50 +08:00
William Cheng
cfbc72f444 Merge branch '4.0.x' of https://github.com/openapitools/openapi-generator into 4.0.x 2018-10-16 16:16:28 +08:00
William Cheng
9e3c7781bb Merge remote-tracking branch 'origin/3.4.x' into 4.0.x 2018-10-16 16:08:11 +08:00
William Cheng
257a97b6cd update petstore samples 2018-10-16 13:19:40 +08:00
William Cheng
ffd72767af
Prepare 3.3.2 snapshot version (#1249)
* release_version_update

* update readme

* restore felix version

* update petstore samples
2018-10-16 10:53:12 +08:00
William Cheng
0136aeefbc
Prepare 3.3.1 patch release (#1247)
* release_version_update

* comment out ensure up to date

* release_version_update_docs

* update release table
2018-10-15 23:18:24 +08:00
William Cheng
0b6e63b427
add file post processing to csharp generator (#1238) 2018-10-15 15:25:19 +08:00
Jim Schubert
6817b4348f [cli] config-help writes doc-compat output (#1239)
This updates config-help to have more control over how the output is
written for the user. We dump config-help output for per-generator
documentation, and this cleans up some cross-platform compatibility
issues that might arise from tweaking the output for clarity in the
target file.

Previously, we'd pipe config-help output to sed, then insert the
generator name, which we then redirected to an output file. The sed
syntax had to include a trailing newline so our tabbed configs would
automatically become code tags in markdown. Inserting newlines into sed
replacement strings doesn't work the same across platforms, mostly
because of Apple's customizations to GNU programs.

This commit moves the generator name and newline insertion into the
command itself. It also includes a new --output option, allowing the
user to specify the output location of the config-help.

Currently, we only dump in plain-text, and it is only coincidental that
our plaintext output results in a desirable Markdown output. If
tabbed lines did not automatically convert to a code style block, some
generators like C# would end up with broken text (`List<T>` would become
just `List`, for example).

I had previously discussed extending config-help to output to other
formats like asciidoc. This commit does not introduce any steps toward
that end.
2018-10-15 15:21:13 +08:00
William Cheng
df98126354
Add an option to enable file post-processing (#1241)
* add option to enable post process file

* fix typo
2018-10-15 15:02:51 +08:00
Rubén Martínez
ded765bcb9 [C#] Fixed issue #1126 with invalid generation of C# children models in allOf clauses (#1127)
* Run ./bin/utils/ensure-up-to-date to re-generate samples run in the CI.

* Fixed issue #1126. DefaultCodegen now sets the hasChildren property of CodegenModel when children models are added to the model. Changed the modelGeneric.mustache template to decide whether to include a base validation model (for children to inherit) based on the hasChildren property, and not the discriminator property.

* Run the ./bin/utils/ensure-up-to-date script after fixing the issue #1126

* Reverted modification in go samples, performed by ./bin/utils/ensure-up-to-date, that are failing in CI.

This partially reverts commit 2168df0f82d987ff8d50963d34efb269b015ef98.
2018-10-15 13:13:05 +08:00
Dec12 | Fujigon
12a702ee07 fix gradle build error on java9+ (#1240) 2018-10-15 11:09:38 +08:00
Christophe Bornet
34409bc0d8 Update spring-cloud generator to use openfeign (#1191) 2018-10-14 12:23:50 +08:00
Marcus Weaver
8909641667 Ctor without parameters 2018-10-13 23:26:44 +03:00
Nico König
9c736731f2 fix: fix return type for api interface (#1218) 2018-10-12 17:48:06 +08:00
Tomasz Prus
71aa421179 fix: python/asyncio no-ssl-verify affects verification of server certs only (#1211)
Bug fix: python/asyncio no-ssl-verify affects verification of server certs
2018-10-12 17:05:01 +08:00
William Cheng
11b7fb4f7b
rename JS environment variable (#1214) 2018-10-12 17:03:50 +08:00
Andrew
ccf9611ad7 Add x-go-custom-tag to go-server generator (#1146)
* Add x-go-custom-tag to go-server generator

* update model templates to include x-go-custom-tag
2018-10-12 17:00:02 +08:00
William Cheng
dd8dd48a62
Revert "Various improvements (#1213)" (#1220)
This reverts commit 448680e764.
2018-10-11 20:11:51 +08:00
William Cheng
448680e764
Various improvements (#1213)
* update readme

* fix logger warning
2018-10-11 15:41:00 +08:00
Rubén Martínez
529a638d11 [C#] Fix issue #1088 with generation of enum classes referenced from other objects (#1089)
* Run ./bin/utils/ensure-up-to-date to re-generate samples run in the CI.

* Fixed the #1088 issue by removing the update of enumeration properties while processing objects that reference them. Launched the ./bin/csharp-petstore-all.sh script.
2018-10-10 21:38:48 -04:00
Matthias Ramsauer
6acf45a108 x-www-form-urlencoded-body-fix (#1187)
* [go] x-www-form-urlencoded-body-fix

* [go] run scripts in bin and bin/security
2018-10-10 12:24:15 +08:00
Akihito Nakano
68a8f2976c
[Spring] Fix character conversion error (#1195)
* Fix character conversion error

ref https://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/ServletResponse.html
> To send character data, use the PrintWriter object returned by getWriter()

* Update samples

* Update spring-stubs
2018-10-09 18:29:58 +09:00
osharav
1a61456f71 Re-enabling typescript node test (#1190)
Explicitly adding node.js 8 type definitions before ClientResponse interface was removed due to deprecation.
2018-10-09 17:14:36 +08:00
William Cheng
56c4751e74
Add JDK 9 support (#1188)
* update jmockit version

* list jvm

* test jdk9 in appveyor

* use latest version of gradle

* update to jdk9

* use openjdk9

* use default java version in appveyor

* use jdk8 docker image

* consolidate bash, ios pom into parent pom

* consolidate circlecii pom into parent pom

* remove circleci pom.xml
2018-10-09 10:25:28 +08:00
mwoodland
8c0e130481 Allow specifying/overriding the parent in the pom file for Java and S… (#1132)
* Allow specifying/overriding the parent in the pom file for Java and Spring generators.

* Don't add extra whitespace to the pom file when the parent isn't overridden.

* Remove accidentally added white space.
2018-10-09 08:34:29 +08:00
Christophe Bornet
5ac33a49f1 [Flask] Upgrade to flask connexion 2.0.0rc3 (#1192) 2018-10-09 07:44:27 +08:00
William Cheng
22049db8c1
fix enum value, update dart petstore samples (#1193) 2018-10-09 07:08:04 +08:00
Kiran-Sivakumar
7d58f308d9 [Java][okhttp-gson] Fix bug when specifying grant-type (flow) for OAuth token retry (#1183)
* Fix bug when specifying grant-type for OAuth token retry

* Update samples

* Update security samples
2018-10-08 17:39:10 +08:00
stkrwork
52a112d90f [C++][Restbed] Fix default value for Restbed (#1186)
* Start working on fixing default value in Restbed Server Api Template

* fix default value in DefaultCodegen

* Revert "fix default value in DefaultCodegen"

This reverts commit ce690069d25f79f4308240a611792a0dd87bb172.

* fix default value in cpprest

* update cpp restbed samples
2018-10-08 01:54:06 +08:00
William Cheng
e85c527f33
Update maven plugin version (#1184)
* update plugin version

* update version in CI pom

* use maven 3.2.5
2018-10-07 11:41:31 +08:00
William Cheng
999f472e4b
Refactor default and example values in Java generators (#1045)
* fix default, example for java okhttp

* update java feign samples

* update samples, doc

* add new doc for dart-jaguar

* update model template

* update jaxrs spec model

* update resteasy sample

* update java samples
2018-10-07 03:56:16 +08:00
Akihito Nakano
a1d242595e Improve "allOf" support (#1169)
* Add test case which reproduces issue340

* Take the first $ref we find in the allOf-List
2018-10-05 23:28:35 +08:00
William Cheng
aa31e42ce7
improve go code format without gofmt (#1173) 2018-10-05 23:27:33 +08:00
raghuraman1
b0dfcf29b3 JAVA Spring <async>false</async> Pushing the improved fix (#1179)
* Pushing the improved fix

* reverting the unrelated change

* saving the revertal properly
2018-10-05 21:56:22 +08:00
William Cheng
b4d835f683
rename perl environment variable (#1172) 2018-10-04 23:54:10 +08:00
William Cheng
06d31cfedb
Better format for Ruby tests (#1166)
* better format for ruby test

* update ruby petstore
2018-10-04 23:53:46 +08:00
Steven Masala
3e3b03f93b FIX: remove special quotation marks from filename generation. (#1157)
* remove left|right point double angle quotation marks

* move to DefaultCodeGen and update TypeScriptAngularClientCodegen to reflect new clean function so that the filename AND imports are added correctly

* rename to a more accurate name :)

* shippable fixes

* shippable javadoc fix

* replaced cleanModelFilename with sanitzeName

* remove DefaultCodegen changes
2018-10-04 23:52:00 +08:00
William Cheng
0f7557ca9d update version 2018-10-03 18:29:29 +08:00
Steven Masala
1916025a53 Fix: allow colons in TS interface property names (#1152)
* Allow colons in interface property names: https://github.com/OpenAPITools/openapi-generator/issues/1080

* replace tabs with spaces

* add docs

* add example in doc

* update docs

* update docs

* remove language specific docs in DefaultCodegen

* Delete addPet-BodyParams.csv

* remove toPropertyName and update toVarName instead for TS
2018-10-03 15:56:58 +08:00
William Cheng
4e8844273b
Prepare 3.3.1-SNAPSHOT (#1154)
* update version

* update petstore samples
2018-10-02 09:40:27 +08:00
William Cheng
e22c7c1c8a
3.3.0 release (#1153)
* update using release_version_update

* comment out ensure up to date script

* update using release_version_update_docs

* remove current master
2018-10-01 23:56:52 +08:00
William Cheng
2b87b309ad
Rename environment variable for Go to post-process file (#1091)
* renmae Go post process file env variable

* add back samples/client/petstore/c/libcurl.licence

* keep go samples up-to-date

* update go petstore samples

* update go samples without formatting
2018-10-01 21:24:32 +08:00
Erik Timmers
dcc0b5e772 [elm] Fix Byte encoder/decoder names (#1151) 2018-10-01 21:20:41 +08:00
William Cheng
3a5ec0a69d Minor enhancements to the MySQL generator (#1148)
* minor enhancements to the mysql generator

* add ybelenko to the README
2018-10-01 16:46:33 +05:00
William Cheng
5357791337 Merge remote-tracking branch 'origin/master' into 4.0.x 2018-10-01 16:38:26 +08:00
Yuriy Belenko
e4b5f50515 MySQL Schema Generator #955 (#1055)
* [Mysql Schema] Add new generator

* [Mysql Schema] Fix default definition

* [Mysql Schema] Add defaultDatabaseName option

* [Mysql Schema] Add jsonDataTypeEnabled option

* [Mysql Schema] Add samples
2018-10-01 15:59:18 +08:00
William Cheng
755dfe53de
Better handling of different types in Elm generator (#1100)
* better handling of different types in elm generator

* [elm] Fix toString for special cases
2018-10-01 15:27:10 +08:00
kemokemo
2040050e55 [Golang][go-gin-server] Fixed issue 1122 with workaround (#1141)
[Golang][go-gin-server] Fix path parameter naming
2018-10-01 15:25:14 +08:00
William Cheng
cbc84254c3
rename scala post proessing env variable (#1143) 2018-09-29 21:39:37 +08:00
Antonio Bellezza
8b47984e3c [Scala-Akka] Generate default values for optional model fields (#1119)
* Generate default values for optional model fields in scala-akka

Fix #1118

* Updated akka-client petstore with defaults for optional model fields

* update petstore sample with scalafmt
2018-09-29 21:21:06 +08:00
Erik Timmers
345b7ec7e5
[elm] Major refactoring; add discriminator support (#1104)
* Use the same name for all exposed encoder & decoders;
* Improve imports (limit exposures);
* Add support for OAS3 discriminators;
* Distinct between 0.18 & latest mustache files.
2018-09-29 12:13:04 +02:00
William Cheng
cbddb08468
Add post processing to files generated by Haskell generators (#968)
* add hfmt support (without updating the sample)

* update haskell httpclient samples with hfmt

* add code format option to haskell servant, minor bug fixes

* update code samples with hfmt

* update samples using stylish-haskell

* rename env variable

* update haskell samples with stylish-haskell

* regenerate haskell samples without stylish-haskell

* regenerate haskell servant sample

* update example-app & tests-integration for OAS2 code
2018-09-29 17:21:03 +08:00
William Cheng
f1f7bdd23f
Add nullable support to Python client (#1073)
* add nullable support to python client

* update PR template
2018-09-29 17:01:13 +08:00
Anand Shah
3a71e59e00 fix optional import (#1083) 2018-09-29 16:57:28 +08:00
William Cheng
e0cbf46041
Add post processing to files generated by TS generators (#1063)
* add file post proess to TS generators

* update ts node petstore with prettier

* update base on feedback
2018-09-29 16:35:24 +08:00
Yuen-Kuei Hsueh
8e57e0d44f fix top-level enum class checking (#1120) 2018-09-28 22:04:41 +08:00
Adam Drakeford
5aad02ed90
Fix for optional and default types (#1107) 2018-09-26 11:48:15 +01:00
William Cheng
70e6e119d1
update dependency (#1116) 2018-09-26 17:30:30 +08:00
William Cheng
cd8bf10b74
rename dart env variable for post processing file (#1101) 2018-09-25 17:23:02 +08:00
Jaumard
df61cd9cb3 fix model generator for snake case open api definition (#1076) 2018-09-25 17:22:19 +08:00
William Cheng
e3b26372cd Rename Env variable for Elm post process file (#1094) 2018-09-25 09:29:12 +02:00
William Cheng
8fb3b707a1
Add post processing to files generated by Python generators (#1072)
* add post process file to python generators

* update python samples with yapf

* revert sample change
2018-09-22 11:50:17 +08:00
kemokemo
14de289fc1 [Go] Add a generator for the gin framework (#1048)
* copy from go-server and add go-gin-server generator

* change the templates for the gin

* fix warnings of the golint tool

* fix the path of script

* add samples

* delete unnecessary comments (#1048)

* make the help message more appropriate (#1048)

* fix the link address format (#1048)

* minor improvement
2018-09-22 00:45:32 +08:00
herojan
abb2690ef5 Kotlin spring server codegen improvements (#1070)
* If required and readonly, a field should be optional. This is to allow people to get and easily put back.

* Use list instead of array, use String instead of kotlin.String etc

* Update samples

* code review: fix annotation formatting

* code review: revert change to use listOf
2018-09-21 16:14:50 +01:00
William Cheng
ed1277348d
add logic to handle uuid in elm generator (#1075) 2018-09-21 21:56:44 +08:00
Christophe Bornet
6dc618fa3f Fix flask connexion support (#1066)
Use the dev-2.0 git branch of flask connexion to fix the generator.
This is not ideal but better than a generator not working at all.

Fix #323
2018-09-20 19:48:28 +08:00
Benjamin Gill
c0a6eaab85 Trim trailing '/' from basePathWithoutHost (#967)
* Trim trailing '/' from basePathWithoutHost

Given that the normal use is {{{basePathWithoutHost}}}{{{path}}}.

* Trim trailing '/' from contextPath
2018-09-20 19:33:31 +08:00
William Cheng
29e9f5bda0
add nullable to Ruby client (#1059) 2018-09-20 19:31:47 +08:00
William Cheng
cc6efe01c7
Add file post processing to Ruby generators (#1062)
* add post processing for Ruby file

* move ruby file post process to abstract ruby class

* remove line break
2018-09-20 19:31:31 +08:00
Stephane Carrez
3cacbcb965 #1043 - [Ada] Operation security scopes are ignored when generating the server (#1044)
* [Ada] Operation security scopes are ignored when generating the server (#1043)
- Update fromOperation() to keep the operation required scopes for each auth
  method and store that information in the x-scopes vendor extensions attribute
- Update postProcessOperationsWithModels() to process the operation required
  scopes and build a list of authMethods which only contain the required scopes
  for the operation and store these authMethods in the x-auth-scopes attribute.
- Update postProcessAuthMethod() to handle the logic of filtering and building
  the operation authMethod (new instances are created because we must not
  modify the global authMethod definitions)
- Update the Ada server templates to use the x-auth-scopes instead of authMethods
  Add a URL prefix parameter for the Ada server instantiation

* Fix the Ada server template to use the x-auth-scopes for operation scopes
2018-09-20 19:31:11 +08:00
Kiran-Sivakumar
0e045bee1b [okhttp-gson] Add support for OAuth access token retry (#1058)
* Add support for access token retry in okhttp-gson lib

* Update expected number of generated files in test

* Update samples

* Update security samples

* Fix default user-agent and update samples
2018-09-20 19:29:59 +08:00
William Cheng
1b2f3fbfb6
Fix alias to map response (#1067)
* fix response reference to map

* update samples

* add null check for openapi
2018-09-20 19:29:33 +08:00
William Cheng
340466066c Add file post-processing to Swift 3.x, 4.x generators (#1069)
* update all swift samples

* format swift code with swiftformat

* minor format fix

* rename environment variable
2018-09-20 20:29:25 +09:00
Thomas Hansen
ca9a4a2ff3 PR: Fix error when giving an array as parameter to an endpoint body r… (#1037)
* PR: Fix error when giving an array as parameter to an endpoint body request

* PR #1037 - Fix issue with array as parameter to operation

* update samples

* PHP - ObjectSerializer::sanitizeForSerialization(): manage \stdClass objects properly

* update samples

* bug fix: missing "use" clause

* update samples

* Changes after @ackintosh review

* update samples
2018-09-19 19:58:56 +09:00
Brian Mooney
b7edad5cd0 Issue 1025: Kotlin generator doesn't support inheritance (#1026)
* allVars is duplicating child preoperties when models are inherited. Filter out these duplicates in the KotlinSpringServerCodegen
  * isInherited property was not being populated in the CodegenModel, re-parse the models in the KotlinSpringServerCodegen class and populate the property here
  * Add template support for Kotlin models which require inheritance from a base class to support oneOf declarations in the api yaml
  * Change optional for parameters to use Kotlins nullable
  * Update petstore api with Optional -> Nullable
2018-09-19 11:26:47 +01:00
Nico König
3027514242 feature: add scaffold for typescript axios template (#892)
* feature: add generator for typescript/axios

* feature: add sample scripts and sample code

* fix: set request body in data property

* feature: add samples and tests for typescript axios client

* test: add tests for typescript axios client
2018-09-18 14:23:52 +08:00
William Cheng
24b234bdbb
Minor improvement to Dart generators (#1042) 2018-09-17 23:18:52 +08:00
manhhavu
9e1dfc0837 [Swift4] Use CodeableHelper's dateformatter in encode() if configured (#984) 2018-09-17 14:27:47 +08:00
Dec12 | Fujigon
5c794a01f8 [Java][Jersey] add @Valid when bean validation is enabled (#1019)
* fix template to add @Valid to POJO fields regarding nest, in java-jersey

* regenerate with for scr in `ls ./bin/*jersey*.sh`; do sh $scr; done

* re-generate with ./bin/openapi3/jaxrs-jersey-petstore.sh

* update api template for jersey1

* re-generate samples

* re-generate samples
2018-09-16 22:36:20 +08:00
Jérémie Bresson
27e343ffef [all] Add leading slash in path if missing (#1034)
* [all] Add leading slash in path if missing

* Fix unit Tests
2018-09-16 16:09:16 +08:00
Vladislav Cheparin
5fc76ba834 [Java][Retrofit2] The part name is not added to the annotation (#1029)
* fixed retrofit2/formParams.mustache

* added play26 to retrofit2-all.sh

* fixed samples
2018-09-16 16:00:38 +08:00
William Cheng
b909656418
fix postProcessFile log message (#1028) 2018-09-15 18:29:30 +08:00
Jérémie Bresson
fe0f2cfad6
[JaxRS-Spec] Fixes in generated pom (#1035)
* build-helper-maven-plugin to add src/gen/java as source folder
* update javax.ws.rs-api to 2.1.1
* add jackson as dependency
2018-09-14 16:59:49 +02:00
ircecho
58e43ceeec [DART2] Maps could not be deserialized in dart 2 (#1007)
* fix[dart2]: due to stronger type checking in dart 2, maps could not be deserialized

* rebuild dart2 petstore
2018-09-14 18:40:37 +08:00
William Cheng
fc35bb17d0
Add option to enable scalafmt for code formatting (#1032)
* add option to enable scalafmt for code formatting

* fix typo
2018-09-14 16:58:27 +08:00
Juan Eugenio Abadie
48e66ed627 Avod use of an empty key value (#991) 2018-09-14 00:56:34 +08:00
William Cheng
94eb1c3c63 Merge remote-tracking branch 'origin/master' into 4.0.x 2018-09-13 22:46:21 +08:00
William Cheng
29322da2f6
Dart (Jaguar) client generator (#998)
* generator for dart jaguar

* migrate to openapi-generator

* fix locale issue

* add auth generation for dart jaguar

* fix generation of jaguar api with auth (#1009)

* update deps (#1016)

* add CI tests for dart jaguar

* update dart jaguar bin script

* trigger build failure

* Revert "trigger build failure"

This reverts commit a7d8bfd47a93f0903932aeff4afefeb7aa4c5c4a.
2018-09-13 21:39:57 +08:00
Akihito Nakano
9a19a064af
Add a CLI option to control logging level (#1000)
* Add CLI option to control logging level

* Update the property name
2018-09-13 21:54:45 +09:00
William Cheng
95302efdfc
Add option to set Feign version (#1005)
* Add option to set Feign version

* add java feign 9x to CI

* update usage for Play

* fix duplicated artifactId
2018-09-13 10:32:09 +08:00
William Cheng
096ac567ce
Revert "[C++][Restbed] Fix default values for Restbed Server generator" (#1027)
* Revert "[gradle plugin] Support Gradle 4.10 (#1011)"

This reverts commit 131cf94fe4.

* Revert "[C++][Restbed] Fix default values for Restbed Server generator (#761)"

This reverts commit f29ba97e8b.
2018-09-13 09:21:39 +08:00
Jim Schubert
131cf94fe4
[gradle plugin] Support Gradle 4.10 (#1011)
* Support Gradle 4.10

Gradle 4.10 is bundled with Kotlin 1.60 and Kotlin DSL 1.0-rc1. The new
Kotlin DSL isn't binary compatible with the `tasks` registration used in
this plugin.

Updating to Kotlin DSL 1.0-rc1 with no other changes would require users
to update to Gradle 4.10.

As a workaround, I've modified the tasks registration being done in
OpenApiGeneratorPlugin.kt, so rather than using the Kotlin DSL's invoke,
it creates tasks manually against the TasksContainer. This works locally
with Gradle 4.7+ for all scenarios in the sample (samples/local-spec).
There may be edge cases that I'm unaware of, and we may want to consider
defining the minimum supported Gradle version of 4.10 in the next major
version of openapi-generator-gradle-plugin if we experience those cases.

* Uncomment snapshots repo (commented it during local testing)

* update pom.xml for exec gradle plugin
2018-09-12 19:19:45 -04:00
stkrwork
f29ba97e8b
[C++][Restbed] Fix default values for Restbed Server generator (#761)
* Start working on fixing default value in Restbed Server Api Template

* fix default value in DefaultCodegen
2018-09-13 01:13:02 +02:00
Sean Farrow
59ad12183f Update the Asp.Net core server generator to support Asp.net Core 2.1 (#1008)
* Update the .net core sdk to v2.1 and update the asp.net packages used.

* Upgrade the SwashBuckle Asp.Net Core package to v3.0.0.

* Update the AppSettings json file and add a file used in development.
Also, remove the web.config file.

* Update the program template to use the web host builder class.

* Update the startup class to use the Asp.Net 2.1 paradigms.

* Update the launch settings json file.

* Update the controller template to derive from the ControllerBase class as aposed to Controller.

* Add the SwashBuckle annotations package.

* Add the SwashBuckle.AspNetCore.Annotations namespace to the controller template.

* Update the Startup template to add comments to the Configuration property and an env parameter to the Configure method.

* Update the startup class so we don't need to inject the hosting environment.

* Update the program class to have hte recommended CreateWebHostBuilder method from asp.net core 2.1.

* Update the asp.net core pet store sample server.

* add back aspnetcore 2.0 template via option

* remove web.config for aspnet core 2.1
2018-09-12 18:42:16 +08:00
sunn
3d4c3c545b
[c++ pistache server] Support basic query handling (#943)
Support basic query handling

Add  helpers for primitive de-serialization
Remove warnings due to unneeded commas
Deserialize basic types in queries
Add dependencies chain for external libraries
Fixes wrong parameter passed to API
2018-09-12 09:53:01 +02:00
sunn
3cfcf77c88
Improvements for qt5 server (#942)
Remove beta tag
Supported nested containers
Move repetitive code to inline function
Fix docker file
Fix CMakeLists.txt when building external project
2018-09-12 09:52:00 +02:00
Adam Drakeford
1ae3403f6d [KOTLIN] [SPRING] Minor bug fixes to generator (#1001) 2018-09-11 21:41:12 -04:00
Juan Eugenio Abadie
2d99836e90 [C++] [cpp-rest-sdk] Check for null values (#990)
* Check whether a value is present but null

* Update Petstore sample
2018-09-11 00:15:44 +08:00
ircecho
6a1e560540 fix[dart2]: improved error reporting (#1006)
* fix[dart]: improved error reporting

* rebuilt dart2 petstore

* rebuilt dart2 petstore with dartfmt
2018-09-11 00:14:50 +08:00
Even André Fiskvik
f80fa08a01 [Swift4] Fix default value for enums (#652) (#656)
This fixes an issue that makes the swift 4 api client fail to compile when using enums with a default value.
The fix changes the toDefaultValue method to check if the property is of enum type, and then returns a properly formatted value.
Looking into the code, I wonder why toEnumDefaultValue is not being used here, which seems to be the case for the java implementation.
2018-09-10 00:18:49 +08:00
Jakob Schmutz
7596fb7119 fix circular import issue in python flask (#946)
* fix circular import issue in python flask

This is very similar change to 3678eaff87dd95348470c
All it intends to do is fix the problem of cirular imports (which was
already fixed for python) in the python flask server.

* removal of type hints in quotes
2018-09-09 23:23:06 +08:00
Ilya Hrankoŭski
aa29219f8c [Java][Feign] Add support for Feign 10 (#977) (#988) 2018-09-09 18:11:59 +08:00
Christophe Bornet
825404a1df
[Spring] Fix reactive + delegatePattern option (#978) 2018-09-08 15:51:05 +02:00
William Cheng
47b3210cb2
Add js-beautify support to JS generator (#961)
* add js-beautify support to JS generator

* replace tab with space

* update samples without JS_BEAUTIFY_PATH
2018-09-08 18:06:27 +08:00
Akihito Nakano
1ead8bcca5
[PHP] Drop support for PHP5.5 on php-client (#993)
* Drop suport for PHP5.5 on php-client

* Update samples

bin/php-petstore.sh
bin/openapi3/php-petstore.sh

* Update security samples

bin/security/php-petstore.sh
2018-09-07 17:39:33 +09:00
Akihito Nakano
4a9b0a91aa
[PHP]Generated lumen code can contain dots in routes (#985)
* Update README

* Remove the codes checking dots contained in path

* Update samples
2018-09-07 17:37:35 +09:00
Jérémie Bresson
abe741f989
Set swagger-parser and swagger-core to version 2.0.4 (#787) 2018-09-06 20:33:37 +02:00
Yann Milin
c5463232d3 [PHP] Fix deserialize ApiException as a Model (#757)
* [PHP] Fix deserialize for default responses. Update samples

* [PHP] Update sample files

* Fix the distination ("-o") of petstore-security-test

* Clean up "petstore-security-test" folder

* Update petstore-security-test sample files

* Update petstore OpenAPI3 sample files
2018-09-07 00:52:59 +09:00
Matt Melling
a8cbae4dc8 [PHP] Upgrade php-cs-fixer to 2.12, enables PHP >= 7.2 support (#769)
* upgrade php-cs-fixer to 2.12

* ran petstore-security-test for php

* updating openapi3 php petstore example
2018-09-06 20:48:00 +09:00