1199 Commits

Author SHA1 Message Date
William Cheng
52065cc1c5 Merge remote-tracking branch 'origin/5.1.x' into 6.0.x 2021-01-18 12:40:31 +08:00
William Cheng
53a5bfecfd Merge remote-tracking branch 'origin/master' into 5.1.x 2021-01-18 11:33:57 +08:00
Johannes Wienke
cd2a0db1ce
Fix counting for large API solutions in generated Python README (#8403)
* Fix counting for large API solutions

Let 2 follow 1.

* Update Python samples with new readme
2021-01-15 13:51:12 -08:00
Justin Black
c4dbd2cfa3
[python] Fixes file upload + download, adds tests (#8437)
* Adds tests for file upload and files upload

* Adds test_download_attachment

* Fixes test_upload_file

* Adds download_attachment endpoint

* Adds test_download_attachment

* Updates assert_request_called_with signature

* Samples regen

* Adds upload download file spec route and sample gen

* Fixes file upload for application/octet-stream, writes test_upload_download_file

* Changes if into elif

* Improves python code in api_client
2021-01-15 13:27:33 -08:00
Toby Murray
99144252f7
Migrate off deprecate Gradle configurations (#8436)
A bunch of gradle configurations have been deprecated, with drop in replacements. Relevant to this project:

compile -> implementation
testCompile -> testImplementation

They're visible by executing e.g. ./gradlew build --warning-mode all with supporting documentation here: https://docs.gradle.org/6.6.1/userguide/upgrading_version_5.html#dependencies_should_no_longer_be_declared_using_the_compile_and_runtime_configurations
2021-01-15 22:32:50 +08:00
William Cheng
e2ad6dbc1b
[Go] Fix response body (#8439)
* fix go response body

* add missing import
2021-01-14 23:32:19 +08:00
William Cheng
22ac8faec7
Revert "[GO][Client] return GenericOpenAPIError instead of error in Execute() (#8137)" (#8427)
This reverts commit 1562afea3980484a7f1819c4f51b0d53a44a009f.
2021-01-14 13:59:21 +08:00
Ronny Pfannschmidt
6b6d1b1a97
[python] fix #8404: avoid shadowing the name Endpoint (#8405)
if a type was named Endpoint, its import for use in the api would shadow
the name Endpoint for the internal utility
2021-01-13 08:38:41 -08:00
Justin Black
ce893a84ff
Fixes object serialization when there is an inline array property which contains a refed enum (#8387)
* Fixes object inline enum defintion with refed enum item

* Adds refed array model example w/ serialization + deserialization
2021-01-08 13:15:55 -08:00
William Cheng
64ae0eed04 Merge remote-tracking branch 'origin/5.1.x' into 6.0.x 2021-01-09 00:15:53 +08:00
William Cheng
18bec1da28 Merge remote-tracking branch 'origin/master' into 5.1.x 2021-01-08 21:06:47 +08:00
Peter Leibiger
2ba0e03629
[dart-dio] Fix serialization of map body params (#8367) 2021-01-07 22:30:16 +08:00
Peter Leibiger
02473d8175
[dart] Cleanup, remove leftover inline objects/docs and regnerate tests (#8362) 2021-01-07 22:29:32 +08:00
Peter Leibiger
c43234711a
[dart-dio] Generate the correct serializers (#8357)
* only generate actually used serializers (anything used in body or response)
* generate previously missing serializers for collection types
* improve formatting
2021-01-07 22:28:37 +08:00
Peter Leibiger
fc22de0522
[dart-dio] Fix failing integration tests (#8335)
This happened due to the merge of #6384 where implicit-dynamics were still allowed.
2021-01-05 22:08:55 +08:00
Hippolyte HENRY
a9c168c400
[ruby] Support aliasing of API keys (#8124)
* Allow aliasing of auth keys

* update sample and add config for feature

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-01-05 20:04:08 +08:00
Peter Leibiger
0c4a928ebc
[dart][dart-dio] Enable strong-mode and strict types (#8231)
* [dart-dio] Enable strong-mode and strict types

This will make it easier to eventually transition to NNBD. Also fix some formatting things.

* [dart-dio] Add implicit-casts: false to analysis options

* [dart-dio] Add dartanalyzer to integration tests

* raise minimum Dart version to 2.6 (to support spread collection)
* add header to all files for language version
* fix some missing imports that can be fixed (some remain due to missing inheritance support)
2021-01-05 09:43:17 +08:00
Josh Burton
604ac6d90f
[dart-dio] Serializes request bodies using a specific serializer so a… (#6384)
* Updates samples

* Handles primitive types
2021-01-05 09:40:32 +08:00
Nicholas Muesch
00d56375b0
Use Map interface for configureApiKeys (#7982) 2021-01-04 10:54:01 +08:00
Tomofumi Chiba
9889e5dfba
[typescript(experimental)] fix for Deno v1.6 (#8265)
* fix for Deno 1.6

* update dependency version of Deno test code
2020-12-28 13:57:00 +01:00
William Cheng
25b0cbe2f1
Prepare 5.0.1 snapshot (#8249)
* update version to 5.0.1-SNAPSHOT

* update samples

* update meta codegen
2020-12-21 17:14:18 +08:00
William Cheng
4261252491 prepare 6.0.0 snapshot release 2020-12-21 16:39:40 +08:00
William Cheng
345b68a107 prepare 5.1.0 snapshot release 2020-12-21 16:35:12 +08:00
William Cheng
d7d5e53f2b
Prepare v5.0.0 release (#8247)
* update to 5.0.0

* update samples
2020-12-21 13:04:11 +08:00
William Cheng
0be3fe6104
Set skipFormModel to true by default (#8125)
* set skipFormModel to true by default

* update tests

* regenerate ruby faraday client

* remove inline object spec files

* more clean up on inline object files

* update samples
2020-12-18 23:57:19 +08:00
Aanisha Mishra
f766735d5c
[Python][Client] Python model directory init missing (#8215)
* include model and api dir init mustaches

* update examples

* remove unwanted changes

* revert unwanted changes in sample

Co-authored-by: aani <aani>
2020-12-18 10:13:35 +08:00
Peter Leibiger
a5377647f4
[dart][dart-dio] Add support for default values (#8201)
* [dart-dio] Generate default value builders

* return `null` when there is no default value instead of `"null"`
* use built_value's `_initializeBuilder` to set default values

* [dart-dio] Fix default value formatting in model doc
2020-12-17 17:50:36 +08:00
Aanisha Mishra
1562afea39
[GO][Client] return GenericOpenAPIError instead of error in Execute() (#8137)
* error to GenericOpenAPIError

* reformatted files

* reformat files

* spaces to tabs

* update petstore examples

* remove extra brackets

* update sample generation

* update go test cases

* update openapi3 go tests

* edit test samples

* update documentation
2020-12-17 16:39:43 +08:00
Peter Leibiger
96e6bc4650
[dart-dio] Allow dynamic headers and add additional dio parameters (#8191)
* fixes some compile errors due to header params not being of type `String`
* add optional `extra` and `validateStatus` parameters from dio
2020-12-16 23:24:09 +08:00
Peter Leibiger
e1c43f1356
[dart][dart-dio] Prevent name clashes with existing dart types (#8198)
* [dart][dart-dio] Prevent name clashes with existing dart types

Can not use dart import aliases for now as this is not supported by built_value. This means we need to add potentially clashing names/classes to an `additionalReservedWords` exclusion list. Starting with a basic list of some http/io classes.

Correctly use `importMapping` and `defaultIncludes` this time around. Improve reserved word checking.

This now successfully generates `ModelList`, `ModelFile` and `ModelClient` models which previously were not generated at all or were wrong types.

* Address review comment

* Update generator docs
2020-12-16 17:25:20 +08:00
Tomas Sykora, jr
180fae02cd
[DART-DIO] [GENERATOR] Make header params with dynamic types (#6915)
* Make header params with dynamic types

Otherwise this will generate code which is not compile-able. Like this:

```dart
        Future<Response<List<StockItemProjectionDirect>>>getAllStockItems(Store storeId,{ int xXChunkNumber,int xXChunkSize,StockItemRequestFilterDto stockItemRequestFilterDto,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {

        String _path = "/api/store/{storeId}/stock".replaceAll("{" r'storeId' "}", storeId.toString());

        Map<String, dynamic> queryParams = {};
        Map<String, String> headerParams = Map.from(headers ?? {});
        dynamic bodyData;

        headerParams[r'XX-Chunk-Number'] = xXChunkNumber;
        headerParams[r'XX-Chunk-Size'] = xXChunkSize;
```

See how the func recieves int argument which then assignes into a string... last 2 lines

* FIX: Dynamic header and sync with upstream

* DART-DIO new samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-16 17:13:50 +08:00
Robert Parini
a4f84b2f8c
[Python][Client] Default to system CA instead of certifi (#8108)
* Use system CA by default and remove certifi

See https://github.com/OpenAPITools/openapi-generator/issues/6506

* Use system CA by default in asyncio client

* Update README_onlypackage.mustache

* Result of ./bin/generate-samples.sh

* Add ssl_ca_cert argument for Configuration

* Result of ./bin/generate-samples.sh

* Remove certifi, use system CA by default
2020-12-15 16:36:35 -08:00
Thomas Hervé
952cd9c689
Include description directly in python docstrings (#8154)
* Include description directly in python docstrings

mustache escaping the description make them render weirdly, including
sometimes unsupported characters in python.

* More parameters
2020-12-15 09:30:50 -08:00
Peter Leibiger
ddd11abb87
[dart][dart-dio] Correctly type responses and futures (#8195)
* don't rely on implicit dynamics
* this is a requirement for NNBD
* add space between return type and some method names
2020-12-16 00:52:47 +08:00
Hippolyte HENRY
81a5e44a6c
[ruby] Improve ruby client examples (#8040)
* [ruby] Improve ruby client examples

* samples

* quote fixes

* Keep enum value

* better string type handling

* fix failing tests

* add space after comment

* update samples

* use Time

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-16 00:10:04 +08:00
Peter Leibiger
70e86a0840
[dart] Fix enums with default value (#8182)
* simplify template expression
2020-12-15 09:56:35 +08:00
Peter Leibiger
f484e0db42
[dart][dart-dio] Formatting improvements (#8180)
* always add trailing commas in arrays and break each line
* make variables final
* improve API formatting (mainly leading spaces)
* remove empty lines and whitespaces
* fix formatting of datatype and description and docs
* consistently use single quotation marks (dart already does this)
2020-12-15 09:55:33 +08:00
Peter Leibiger
e412145a1f
[dart][dart-dio] More enum fixes for inner types (#8174)
* correctly generate enums from `mostInnerItems`
* use `datatypeWithEnum` which should always be he correct type
* dart generators prefix inner enums with the classname of the containing class, ensure datatypeWithEnum always matches
2020-12-14 23:05:31 +08:00
Peter Leibiger
351377ca29
[dart-dio] Fix x-www-form-urlencoded body not working (#8175)
* only use `FormData.fromMap()` for multipart content, `FormData` does not work with `x-www-form-urlencoded`
* use a basic map for `x-www-form-urlencoded` content
* fix formatting
2020-12-14 15:36:18 +08:00
Peter Leibiger
7f9012c554
[dart-dio] Use built_value collection types without string replacement (#8153) 2020-12-14 00:00:18 +08:00
Peter Leibiger
cd0257b0e5
[dart][dart-dio] Enum improvements (#8149)
* [dart] Always use the correct enum data type

* use raw strings for enum string values

* [dart-dio] Use raw strings for built_value enums

`@BuiltValueEnumConst` does some wierd string handling in the generated code `r'\$'` becomes `'$'`. This is different compared to the wireName in `@BuiltValueField`
2020-12-13 23:59:29 +08:00
agilob
79395de9b7
[java] Generate "static final" instead "final static" (#8158)
* Generate java code with "static final" instead "final static"

* Regenerate code with "static final"
2020-12-11 10:51:57 +08:00
Peter Leibiger
a93a60b6eb
[dart] Handle enumVarNames for negative names (#8143) 2020-12-10 18:59:23 +08:00
Peter Leibiger
4ad6d0bfe5
[dart] Variable/Operation/Model naming (#8123)
* [dart] Properly escape param/var names that clash with Dart types

* [dart] Add tests for var/enumVar names

* note: public and private are no keywords in Dart
* some tests are still wrong, some are commented out

* Fix typo

* [dart] Improve variable name escaping

* add more tests

* [dart] Fix operationId naming

* [dart] Fix upper case var name with leading underscore

* [dart] Correctly support model prefix/suffix

* [dart] Support spaces in property names

* Call super for empty operationId

* [dart] Fix and improve enumVar naming/generation

* use same handling for all 3 generators
* allow `updateEnumVarsWithExtensions` to have access to the data type
* improve `x-enum-values` handling and add supprt for other enum vendor extensions
* remove duplicate and outdated tests from `DartDioModelTest`
* add more tests to `DartModelTest`
* no longer force lowercase enums for plain dart generator (breaking)
* this change also removes the trailing underscore from plain dart generator (breaking)
2020-12-09 23:21:08 +08:00
Peter Leibiger
2cdbfd63eb
[dart][dart-dio] Enum fixes specific to Dart DIO (#8114)
* [dart-dio] Fix wrong escaped serializer names

* [dart-dio] Prevent enum name collisions in inlined enums

Prefix the private built_value instances with the enum class name. Prevents clashes when multiple inline enums contain the same value - for example `EnumTest`.  No breaking changes here as all the changed fields/references are private and automatically re-generated with built_value.
2020-12-09 21:12:03 +08:00
Peter Leibiger
144e08b4fc
[dart] Use raw strings for json/header parameter names (#8131)
This should fix all problems related to unescaped characters in strings that are assumed to be raw - e.g. `json[r'$special[property.name]']`
2020-12-09 11:12:48 +08:00
Josh Burton
e346593766
[dart-dio] fixes Enum classes with integer values (#8129)
* [dart-dio] Enum classes with int values now generate correct BuiltValueEnumConst annotation

* [dart-dio] Address PR comments
2020-12-09 11:09:57 +08:00
Josh Burton
7fb5e2538b
[dart-dio] Fixes errors when primitive return types are attempted to … (#7411)
* [dart-dio] Fixes errors when primitive return types are attempted to be deserialized as json

* Updates samples

* Removes old files
2020-12-09 11:07:29 +08:00
Peter Leibiger
7fae4ab411
[dart] type improvements (#8111)
* [dart] Configure and use import mapping

This prevents models from being generated which would clash with exisiting dart types, e.g. List.

* [dart] Fix decimal format not supported

* [dart-dio] Remove redundant modelToIgnore & ignore dart:core import

* modelToIgnore is now handled via importMappings the same way other generators do this
* choose not to import dart:core as this is available by default

* [dart-dio] EnumClass is a reserved word in built_value

* Review changes

* Fix regenerate docs
2020-12-08 12:00:12 +08:00
fbl100
99d83712a8
Fixes issue #8014, _check_type flag not being honored. (#8053)
* Fixes issue 8014, _check_type flag not being honored.

Updated model_utils.mustache to pass the check_type flag into attempt_convert_item(). Failure to do so
results in type validation errors occurring when the user has specifically requested that they be disabled.

* regenerated samples

Co-authored-by: Frank Levine <frank.levine@blacklynx.tech>
2020-12-07 12:18:16 -08:00