1199 Commits

Author SHA1 Message Date
William Cheng
0d50b4044f
fix TS model tests in Windows (#13072) 2022-08-04 01:24:15 +08:00
Thomas Hansen
1e3a39b460
[PHP] Add support for server variables in operations (#12982)
* [FEATURE] Support for server variables in operations

* [AUTOGENERATED] update samples

* [PHP] Added tests for server variables in operations
2022-08-04 00:15:51 +08:00
Justin Black
c959a6cf38
[python-experimental] Fixes issue 12986 (#13054)
* Adds fix for api names and tag names

* Removes sample spec

* Samples regenerated
2022-08-01 15:17:25 -07:00
Justin Black
68fb5a96c5
[python-experimental] consolidates endpoints into paths module (#13007)
* Adds endpoint creation in path modules

* REgens samples

* Adds BaseApi so there can be 2 class interfaces for http method and operationid

* Adds paths init

* Adds enum containing paths

* Uses path enum for endpoint paths

* Adds camel case to undersce converstion in to ineum var name

* Fixes path enum generation

* Moves path api combination module into apis

* Moves tag apis into a tags module

* Adds path_to_api

* Changes module path to paths

* Fixes tag api imports

* Fixes self type in endpoint methods

* Adds test changes

* Adds tag enum

* Adds tag_to_api

* Adds missing tag

* Fixes self types in endpoint methods

* Refactors java endpoint generation to be simpler

* Further refactors generateEndpoints

* Generates one test file per endpoint

* Updates v3 samples

* Fixes endpoint tests, all tests passing now

* Samples regenerated

* Fixes petstore tests

* Generates separate endpoint test methods on each endpoint

* Fixes api docs and enum string values in those docs

* Regenerates samples

* Removes pass to fix tests
2022-08-01 11:22:35 -07:00
uesyn
bc65be4c9a
[typescript] typescript client generator supports import mapping (#12957)
* support import mapping

* Remove unused imports

* Remove unused variable

* Not to clear importMapping

* Re-generate samples

* Use same model import path everywhere

* Move import mapping logic from toModelImport method

Co-authored-by: Bodo Graumann <mail@bodograumann.de>
2022-07-27 17:09:27 +02:00
Justin Black
2b9a1ad0fc
[python-experimental] Consolidates model tests into a subfolder (#13006)
* Consolidates model tests into a subfolder

* Regenerates samples
2022-07-24 14:02:34 -07:00
Justin Black
30f1f11205
[python-experimental] Adds response body tests for json content type (#12988)
* Tags renamed

* Spec updated to add response bodies

* Adds correct tag to response body routes

* Adds response body autogen tests

* Adds pos test cases, removes dead code

* Adds and uses api_test_partial

* Samples regenerated
2022-07-24 12:33:23 -07:00
Ruben Fiszel
0b31bd4705
[Typescript] Support text/plain by ObjectSerializer.parse (#12888)
* [Typescript] Support text/plain by ObjectSerializer.parse

* generate-samples

* update samples

* clean up spaces

Co-authored-by: William Cheng <wing328hk@gmail.com>
2022-07-23 20:38:36 +08:00
Justin Black
d1c2230709
v303 unit test spec, adds post json request bodies (#12875)
* Adds post request body routes and test data to spec

* Sample regenerated

* Adds tags and post endpoints

* Uses refs to tests examples in requestBodies

* Stops passing in test_examples into generate_operation

* Adds testCases to MediaType

* Adds refs to test cases in media type

* Adds post request body examples

* Fixes enum 1 ingestion of 1.0

* Only generates test examples when they exist

* Regenerates samples
2022-07-21 15:34:49 -07:00
William Cheng
c26e19cbc0 Revert "Add support for string response deserialization (#12910)"
This reverts commit b8524bee232a55e28693354ab543b91e3f65629a.
2022-07-21 12:58:46 +08:00
Emanuele Saccomandi
b8524bee23
Add support for string response deserialization (#12910)
* Add support for string response deserialization

* updated samples

* updated samples

* realigned to master

* fix: errors were not getting thrown

* updated samples

* fix: errors were not getting thrown

* updated samples
2022-07-21 12:45:50 +08:00
Ruben Fiszel
810a8b5937
[Typescript] Support text/plain by ObjectSerializer.stringify (#12799)
* [Typescript] Support text/plain by ObjectSerializer.stringify

* Update ObjectSerializer.mustache

* Update ObjectSerializer.mustache

* Update ObjectSerializer.ts

* generate samples

* generate samples

* update samples, remove trailing spaces

* Update modules/openapi-generator/src/main/resources/typescript/model/ObjectSerializer.mustache

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* regenerate samples

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@bithost.ch>
2022-07-15 11:35:34 +02:00
Justin Black
ca4a86ea55
Turns on json-schema python-exp anyOf + oneOf unit tests (#12864)
* Spec updated to anyof only

* All tests turned on

* Revert version file

* Adds oneOf tests also
2022-07-14 09:57:43 -07:00
Justin Black
01afbaecd8
[python-experimental] turns on allOf unit test cases (#12826)
* Spec regenerated with only allOf on

Sample regnerated

Fixes a bug where AnyType composed schemas omitted validations, Fixes a bug where properties in AnyType schemas were omitted, Stops storing multipleOf value in a list

Adds required variable info to AnyType classes

Samples regenerated

Turns all unit tests back on

* Samples regenerated

* Docs and models regenerated
2022-07-13 19:27:55 -07:00
Justin Black
c44fe8a04a
Fixes fromProperty when property is required vs optional (#12858)
* Adds required boolean to fromProperty

* Adds required to other method signatures

* pythn-exp sample regenerated

* Samples regenerated

* Adds java test of fix
2022-07-13 18:17:33 -07:00
Oleh Kurpiak
2e2da7bc82
[Spring] fix deprecated generation (#12832) 2022-07-13 11:08:28 +08:00
William Cheng
9d6b12591e
Fix set, map import (#12818)
* fix set, map import

* update samples

* update tests
2022-07-10 14:58:55 +08:00
William Cheng
f242b5e1dd
Skip import of allOf composition schema (#12798)
* skip import of allOf composition schema

* update samples

* allow python generator to keep old behaviour

* update js import
2022-07-10 14:58:22 +08:00
Justin Black
d6b360d47f
[python-experimental] Allow schema instances to be passed in and pass additional schema validations (#12758)
* Converts all schema instances back into primitives in cast_to_allowed_types, fixes test test_deserialize_oneof_reference

* Updates type hint

* Adds validated_path_to_schemas input

* Adds debugging, storess validated schemas in validated_path_to_schemas

* Adds __process_schema_classes

* Simplifies class creation for enums, True/False/None

* Removes unused methods

* Fixes two tests

* Removes unneeded method _enum_by_value

* Adds and uses validation_ran_earlier

* Skips running validation if already ran, base_classes changed to seen_classes

* Adds and uses validation_ran_earlier

* Simplifies __get_simple_class

* Casts None/True/False into NoneClass and BoolClass instances to make tpye checking and unique items checking simpler

* Always cast file input to FileIO, removes __get_simple_class

* Moves type checking to separate class

* Moves validation checking into a _validate method

* Moves enum value checking into SchemaEnumMaker's _validate method

* Fixes test_dict_validate_direct_instantiation_cast_item

* Removes spy_decorator

* Fixed test_dict_validate_direct_instantiation

* Fixes test_list_validate_direct_instantiation_cast_item

* Fixes test_list_validate_direct_instantiation

* Fixes test_list_validate_from_openai_data_instantiation

* Fixes test_dict_validate_from_openapi_data_instantiation

* Fixes test_upload_files

* Samples regenerated

* Reverts version file
2022-07-09 18:06:09 -04:00
William Cheng
6cae0fbb78 Merge remote-tracking branch 'origin/6.1.x' 2022-07-04 01:22:51 +08:00
William Cheng
9e412edb64
Prepare 6.0.1 release (#12762)
* update to v6.0.1

* update doc

* update samples
2022-07-03 23:36:46 +08:00
Gabriel Mazetto
b97a4ad12a
Generate .gitlab-ci.yml files for Ruby template (#12750) 2022-07-03 17:52:32 +08:00
Justin Black
6158274f65
Adds openapi v3.0.3 unit test spec, includes test cases, autogenerates model tests with them (#12619)
* Adds draft6 tests and python file reader

* Adds processing of multiple files

* Moves test examples into a different component so component schemas can be booleans

* Excludes boolean schema cases and some others that contain patternProperties

* Adds automatic test generation, template not quite working with indentation

* Turns on allOf tests, some failing

* Adds more generated components and tests

* Adds enum tests

* Turns on all of themissing tests

* Adds exclmax and min exclusion reasons

* Adds items test cases

* Adds maximum

* Adds maxItems

* Adds maxLength

* Adds maxProperties

* Adds minimum

* Adds minItems

* Adds minLength

* Adds minProperties

* Adds multipleOf

* Adds not

* Adds oneOf

* Adds pattern

* Adds patternProperties

* Working on properties examples, partial fix for escaped characters

* Further improves example string escaping

* Fixes properties test cases

* Adds draft6 test samples license

* Adds ref

* Finishes ref

* Adds remoteRef

* Adds required

* Improves required testing

* Fixes build error / javadoc warning

* Fixes uniqueItems bug in python-experimental

* Turns all tests back on

* Fixes 2 failing tests, all python tests pass

* Fixes java npe errors

* Fixes formatting of tests, indentation fixed

* Test fase name fixed to toTestCaseName, docstring added to ObjectWithTypeBooleans

* Fixes typo

* Adds test deletion to samples generation, samples regenerated

* Updates python-exp unit test sample, includes new ref examples
2022-07-01 13:46:02 -07:00
William Cheng
c982421495
[Go] use EqualFold instead instead of comparing strings in lower case (#12741)
* use EqualFold instead in the go client

* update samples
2022-06-30 23:09:10 +08:00
William Cheng
29ea48ee96
update jackson-databind-nullable to 0.2.3 (#12693) 2022-06-25 12:45:17 +08:00
jld3103
2c9bd4a28f
Put null values into serialized output in dart2 generator (#12569)
* Put null values into serialized output in dart2 generator

* Update samples
2022-06-25 10:07:00 +08:00
Jorge Rodríguez Martín
8b7736501d
Fix cookies in parameters are always generated as required (#12599)
* Fix cookies in parameters are always generated as required

* Fix cookies in parameters are always generated as required
2022-06-16 17:50:16 +08:00
Justin Black
a00ae4631d
Fixes double serialization bug in python-experimental (#12561)
* Partial template update, simplifies ref6570 serialization

* Updated serialization

* Typo fixes

* Fixes test_query_style_form_serialization

* Fixes test_cookie_style_form_serialization

* FIxes test_style_simple_in_path_serialization

* Fixes test_style_simple_in_header_serialization

* Fixes many parameter tests

* Deletes duplicate method

* Fixes TestParameter.test_path_params_no_style

* Fixes test_style_pipe_delimited_serialization

* Fixes test_header_params_no_style

* Fixes test_style_space_delimited_serialization

* Fixes test_query_style_form_serialization

* Fixes test_cookie_style_form_serialization

* Fixes test_query_params_no_style

* Fixes test_cookie_params_no_style

* Fixes test_delete_endpoint_without_request_body

* Fixes all tests

* Reverts version file

* Adds test_get_user_by_name to test path param url encoding

* Adds test_body_with_query_params

* Samples regenerated
2022-06-13 07:45:15 -07:00
William Cheng
3bc4416554 update go samples 2022-06-11 09:24:50 +08:00
Beppe Catanese
aeb40ab0ae
[Go] Address Gosec vulnerabilities in Go client mustache template (#12540)
* Fix potential file inclusion via variable

* Fix deferring unsafe method "Close" on type "*os.File"

* Update samples

* Correction to use existing variable

* Correction generated samples
2022-06-11 09:10:48 +08:00
Jean-François Côté
45f430f5c8
Fix problem when uploading file using form-data in jersey2 client (#12563)
* Fix problem when uploading file using form-data in jersey2 client

* Remove serialization that is not required for most cases

* Small fix
2022-06-11 09:08:51 +08:00
Mike Welsh
5462681348
Add milestone repository for Spring maven plugin (#12530)
* Add milestone repository for Spring maven plugin

* Update Springdoc version
2022-06-07 10:51:51 +08:00
Antonio Sagliocco
5b44aaf8d7
[Dart][Client] Support parsing DateTime (#12433)
* Support DateTime parsing

I've got issue in parsing an Array of Strings in datetime format, which the generator translates into a List<DateTime>.

This just fixes it

* update dart sampels

Co-authored-by: William Cheng <wing328hk@gmail.com>
2022-06-04 21:59:46 +08:00
Mike Welsh
fbc35a2a6f
[BUG] Use https URL for Spring milestone repository (#12512)
- Also set version for spring maven plugin as it does _not_ work with the milestone version
2022-06-03 00:36:45 +08:00
Matthias Wimmer
bcc77d4ac4
Fix for #12504: invalid elm code for paths containing UUIDs (#12506)
Fixes #12504
2022-06-01 14:00:02 +02:00
Kuzma
6f322060f7
[Typescript] Support text/html by ObjectSerializer.parse (#12459)
* add support text/html

* regenerate samples

* test
2022-05-30 11:51:37 +02:00
Akhil Nair
e823290c8f
[PYTHON] GetItem not working for Client generated allOf model and broken since 5.2.0 (#12239)
* I feel the issue is due to the creation of self._var_name_to_model_instances while doing the deserialization of the data.

Earlier the Python SDK code was using get_var_name_to_model_instances function which was adding var name to model instances that contain it. So <class 'openapi_client.model.stream_options_all_of'> will not part of mapping in self._var_name_to_model_instances for variable name stream_options.

Now with the latest Python SDK code following is the way through which var_name_to_model_instances is created:

    for prop_name in model_args:
        if prop_name not in discarded_args:
            var_name_to_model_instances[prop_name] = [self] + composed_instances
Now as we can see that the var_name_to_model_instances is populated with self and composed_instance which will also contain stream_options_all_of as a composed instance and there will be no check that if stream_options is present in composed_instances or not.

As there is no attribute_mapping found for stream_options in stream_options_all_of, the type for stream_options will be treated as dict for mapping stream_options_all_of as mentioned by @Chekov2k.

So what I suggest is the following code:

    for prop_name in model_args:
        if prop_name not in discarded_args:
           var_name_to_model_instances[prop_name] = [self] + list(
                filter(
                    lambda x: prop_name in x.openapi_types, composed_instances))
This way we can check if the property name is present in that composed instance or not. If it's okay for @spacether I can raise a PR for this.

* [get_item_all_of_bug]
Added samples, test cases to validate all_of schema.

* [getiem_all_of_bug]

Updated docs and samples.

* [getiem_all_of_bug]

Updated test cases, docs and samples.
2022-05-27 21:09:48 -07:00
William Cheng
5307a8dafd update samples 2022-05-27 01:05:36 +08:00
cachescrubber
71ea659195
[Java/Spring] Support Spring Boot 3 and Jakarta EE 9 (#12407)
* Migrate annotation.Generated

* Upgrade jakarta.servlet and jakarta.validation

* Prepare pom.xml for spring boot 3

* Introduce spring-boot-3 sample config.

* Create spring-boot-3 sample.

* Introduce useSpringBoot3 cli option.

* Generate Docs

* Add spring milestone repo

* Generate Samples

* Adjust Unit Tests

* Add Spring Boot 3 Support to spring-cloud library

* generate spring cloud 3 sample

* Remove springfox

* Fix typo.

* No longer support SpringFox and Swagger1 with Spring Boot > 3.x

* Generate Docs

* Use Spring Boot 3.0.0-M3

* Generate Samples
2022-05-27 00:07:19 +08:00
William Cheng
5bd94b8fa0 prepare 6.1.x 2022-05-26 12:58:25 +08:00
William Cheng
36a9cf394d
update samples (#12466) 2022-05-26 12:13:59 +08:00
William Cheng
69f79fb789
Prepare 6.0.0 release (#12463)
* prepare 6.0.0 release

* update samples

* update meta codegen
2022-05-26 10:28:01 +08:00
0xNF
96dd6c5806
[Dart] Fix incorrect generation of additionalProperties:true (#12165) (#12426)
* Update samples

Co-authored-by: 0xNF <0xNF>
2022-05-25 11:58:45 +08:00
Peter Leibiger
111675b89b
[dart][core] Fix reservedWordsMappings (#12436)
* [core] Fix naming of reservedWordsMappings 

* `GeneratorSettings` used a wrong name (missing `s`) which resulted in config loaded from YAMl files not working

* [dart] Respect reservedWordsMappings when checking for reserved words
2022-05-25 11:56:51 +08:00
William Cheng
de8decc9f5
throw exception when failed to refresh token (#12431) 2022-05-24 14:51:39 +08:00
Justin Black
4d544994fd
[python-experimental] BoolSchema + NoneSchema improvements (#12411)
* Moves is_none is_true is_false methods into base mixins, adds tests

* Improves docstrings
2022-05-23 15:55:49 -07:00
cachescrubber
8be490d130
Upgrade Spring Boot to 2.5.14 / 2.7.0 (#12408)
* Upgrade Spring Boot to 2.5.14 / 2.7.0

* Generate Samples
2022-05-20 20:24:13 +08:00
Artem Kuzmenko
5221ca2b0a
feat(typescript): add repository field to package.json (#12292) 2022-05-16 09:54:37 +02:00
Peter Leibiger
02f16267cf
[dart] Bump min dio version to prevent unused import (#12354) 2022-05-13 14:09:33 +08:00
William Cheng
12cdacabbf
[Inline model resolver] better handling of inline responses and bug fixes (#12353)
* better handling of inline response schemas, bug fixes

* update samples

* add new files

* better code format

* remove unused ruby files

* fix java test

* remove unused js spec files

* remove inline_response_default_test.dart

* fix webclient tests

* fix spring tests
2022-05-13 10:17:59 +08:00