1058 Commits

Author SHA1 Message Date
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
Nick Dunne
d38cb1b37a
[java][spring] added springdoc support for service metadata and security (#12346)
* added springdoc config file to codegen

* added mustache template for springdoc config

* changed type to all caps so it can be used in the template

* added security scheme details
caveat: didn't add oauth2 flows

* removed url not supported by codegensecurity

* Fixed default doc provider in help message

* refactored config file generation test
and added springdoc test

* removed default codegen modification
implemented through booleans in template instead

* added new/updated generator files

* fixed escaping of description

* fixed appDescription in template
removed if and fixed escaping

* updated generated files again

* updated to springdoc in generator docs
2022-05-18 11:20:54 +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
William Cheng
d135f1992e
Fix inline allOf in request body (#12348)
* fix inline allof in request body

* update samples
2022-05-12 12:51:36 +08:00
William Cheng
ad3b5f7045
[Inline model resolver] various improvements (#12293)
* better handling of requestbody in the inline resolver

* remove commented code

* better request body naming

* fix unique naming

* minor code format change

* removed additional underscore from names, fix test

* more fixes, update tests

* fix all tests

* undo changes to default codegen

* update samples

* update python tests

* add new files

* update samples
2022-05-10 17:13:57 +08:00
Justin Black
8fc85530e8
[python-experimental] fixes delete endpoint with no body use case (#12287)
* Generates delete_coffee endpoint

* Adds test of delete_coffee

* Removes .run files

* Fixes bug and adds test

* Reverts version file

* Reverts function sig

* Removes comma
2022-05-02 18:42:13 -07:00
Peter Leibiger
89d17e2845
[dart] Rename dart-dio-next to dart-dio and make it stable (#12258) 2022-04-30 16:43:11 +08:00
William Cheng
b6a8037f62 update samples 2022-04-27 20:45:24 +08:00
Michael Marner
e6be5543dd
[Dart-Dio-Next]#9082 Add json_serializable serialization option (#9980)
* PoC json_serializable in dart-dio-next

* Move build.yaml template into json_serializable dir

* Undo implicit-dynamic change

* Fix automatic formatting

* Treat non-required fields as nullable

* Make class properties final

* Fix error introduced by merging in master

* Fix map creation when deserializing

* Exclude built files from analysis

* Add new dio import props

* Fix broken merge

* Fix configuration of nullable properties

* Only add api_util import if using built value

* Add config param to set properties as final

* Fix syntax error due to merge

* Update to simplified dio configuration

* Add missing api constructor template

* Fix import for multipart files

* Fix inclusion of library deserialize template

* Update docs

* Remove trailing newline from class

* Fix whitespace in generated templates

* FIx built value generation problem caused by merge conflicts

* Escape dollar signs in strings

* Handle enums

* Config for json_serializable sample

* Generate sample for json_serializable

* Revert "Escape dollar signs in strings"

This reverts commit 6e2a3aeea0450518433f2a07fe7cda92272b18a5.

* Use raw strings when dealing with enum values

* Add json_serializable Maven module ind fix number based enums

* regenerate all tests

* Update docs and fix wrong maven module

* add a beta hint to json_serializable option

* Update minimum dart sdk with json serializable

* Use dart 2.14 when testing Dart samples

* Update codegen to remove analysis errors in output

Co-authored-by: Peter Leibiger <kuhnroyal@gmail.com>
2022-04-27 16:12:22 +08:00
William Cheng
e0d8d0f5d6
better code format for python cilent (#12251) 2022-04-27 16:00:44 +08:00
jld3103
37905e8bfa
dart2: Fix authentication (#11360)
* dart2: Fix authentication

* dart2: Update samples
2022-04-27 02:13:19 +08:00
Justin Black
5de527e784
Enables test_inline_composition (#12240) 2022-04-25 22:09:31 -07:00
Justin Black
c456de40c0
Adds ability to turn inline model resolver on or off and uses it in python-experimental (#12198)
* Adds getUseInlineModelResolver and uses it

* Regenerates python-exp samples

* Regenerates docs

* Samples regenerated

* Moves codegenProperty.complexType setting

* Fixes python-experimental tests

* Reverts vesion file change

* Improves type setting code for python-exp

* Fixes AnyType type hint

* Samples regenerated
2022-04-25 21:44:05 -07:00
William Cheng
23ee8fdf7a
better code format for python client (#12231) 2022-04-25 23:25:42 +08:00
Dmitry Vasilev
6f1fa4592b
[BUG][python] Fix PEP8 E111 issue in rest.mustache (#12229)
* Fix PEP8 E111 issue

* Update samples
2022-04-25 17:00:27 +08:00
William Cheng
4ee5f72214
Use LinkedHashMap for deterministic iteration order (#12230)
* to LinkedHashMap

* LinkedHashMap

* allModels to LinkedHaskMap

Co-authored-by: yilinwang <linda.yilin@gmail.com>
2022-04-25 13:33:24 +08:00
William Cheng
8e49875871 update samples, docs 2022-04-24 15:38:16 +08:00
adessoDpd
1602942292
[Wsdl] Adding cli-option for generating different versions of WSDL-files regarding Media type versioning (content negotiation) (#12206)
* add wsdl version generation

* add option to use specified operationId

* update samples

* update cli description
2022-04-24 15:29:09 +08:00