1199 Commits

Author SHA1 Message Date
Justin Black
57f5cc4000
[python] fixes bugs (#13581)
* Adds bug fixes

* Samples and docs regenerated

* Samples regenerated
2022-10-03 11:15:16 -07:00
William Cheng
ac7ebf67dd
Prepare 6.2.1 (#13517)
* update to 6.2.1-SNAPSHOT

* update samples

* update doc
2022-09-25 00:10:30 +08:00
William Cheng
24f476a381
prepare 6.2.0 release (#13514)
* set release version to 6.2.0

* update samples

* comment out rust server test in travis
2022-09-24 21:44:42 +08:00
Justin Black
7e73645303
Switches python-experimental in as the primary python client (#13501)
* Changes python to python-prior

* python -> python-prior, python-experimental->python

* Renames sample spec directories

* Samples regnerated

* Regenerates docs

* Fixes test

* Samples regenerated

* Updates renerators list

* Fixes made to python paths in pom.xml

* Fixes node4 sh file paths
2022-09-24 16:19:38 +08:00
Justin Black
d25cdbb2ce
[python-experimental] removes enum cls factory (#13491)
* Movs enum info, changes cls factory to base class + updates samples

* Fixed docs for enums, they show the allowed bool and None values now
2022-09-22 11:08:09 -07:00
Justin Black
5f9910dcab
[python-experimental] reduces python version (#13481)
* Removes classmethod property combinations

* Changes python version to 3.8

* Changes python version to 3.7

* Tests fixed

* Samples updated

* Adds getAddSuffixToDuplicateOperationNickname and uses it in python-exp, samples regenerated

* test_paths regenerated

* Fixes bug

* Adds typing_extensions requirement
2022-09-21 18:41:11 -07:00
Justin Black
903f2e2e2e
[python-experimental] improves documentation (#13477)
* Improves docs generation

* Adds inline composed schemas

* Adds missing from property

* Adds notes info

* Fixes spacing

* Updates notes, generates container properties

* Adds anchors to property schema docs

* Adds format info to docs

* Adds items schema documentation

* Adds doc for additionalProperties

* Adds anchors for response types

* Fixes anchors in endpoint

* Fixes api doc link to model doc

* Removes returnType from api docs because it is unused

* Fixes float and double tests
2022-09-20 14:53:58 -07:00
0xNF
d75b7b6194
[Dart] Remove toString() call in enum TypeTransformers (#13452)
* Updated samples

* [Dart] Removed 'toString' check on enum TypeTransformers (#12167)
2022-09-20 13:22:31 +08:00
Elton H.Y. Chou
4a2845152d
[python-experimental] Fix error message (#13471)
* fix error message formatting

* add more infos in error message
2022-09-19 15:40:53 -07:00
Justin Black
43375b9392
Upgrades swagger parser to 2.1.1, allows ingestion of 3.1.0 specs (#13133)
* Upgrades swagger-parser

* Removes additional property and halting of spec processing

* Updates tests

* Docs updated
2022-09-17 08:33:47 -07:00
Justin Black
048af8eeae
[python-experimental] simplifies type checking (#13437)
* Better control of when to write MetaOapg

* Makes MetaOapg in Schema a type hint rather than assignmnet

* Samples regenerated

* Adds tuple types

* Removes types info

* Adds _types

* Samples regenerated

* Adds missing mixins, samples regenerated

* SchemaTypeChecker removed

* Samples regnerated
2022-09-15 17:17:39 -07:00
Justin Black
3177277b52
[python-experimental] adds more base class mixins, preparation for v3.1.0 type arrays (#13436)
* Removes unnecesary typing.Unions

* Adds qty 3 mixin

* Adds qty4 mixin

* Adds mixins for 3-5 type combinations

* Regenerates samples
2022-09-15 11:34:44 -07:00
Oleh Kurpiak
0c6a951615
[Spring] Bean validation for headers (#13414) 2022-09-14 23:07:08 +08:00
Elton H.Y. Chou
8e66294bfe
[python-experimental] Enhance octet-stream deserialize (#13402)
* [python-experimental] Enhance octet-stream deserialization

When the headers didn't provide the filename, use the url of response to
extract filename.

* [python-experimental] Remove todo comment.

* [python-experimental] Fix test code.

* Update samples

* [python-experimental] Refined the method and the test

+ Early return when the url is empty or `None`.
+ Removed unused f-string prefix.

* [python-experimental] Comapre url is None explicitly.

* Update samples.
2022-09-12 12:04:14 -07:00
Justin Black
c59759f20a
Adds IJsonSchemaValidationProperties format getter and setter +uses the format info (#13360)
* Adds format getter and setter

* Updates codegenProperty

* Updates codegenModel

* Updates codegenParameter + Response

* Sets format and removes unused import code in python-experimental

* Samples regenerated

* Samples regenerated

* Adds AnyTypeAndFormat

* Separates format bases out from their str or number bases

* Docs updated

* Updates python-exp, stops setting isDate and uses format instead

* Removes python-experimental isDate usages

* Fixes password usages

* Turns off isDateTime in python-experimental java layer

* Sample regnerated without isDateTime

* Removes isUuid

* Turns off isDecimal, decimal_payload broken

* Removes isDecimal

* Removes isByteArray

* Removes isBinary python-exp usages

* Removes isFloat isDouble setting from python-experimental

* Removes isDouble isFloat usages in sample

* Stops setting isShort and isLong in python-exp java layer

* Removes isShort isLong usages from python-exp and generates sample

* Adds decimal as integer input

* Adds missing bool type

* Adds validations to format mixins, adds test_uuid

* Adds test_date

* Adds test_date_time

* Adds test_number

* Adds test_int32

* Adds test_int64

* Adds test_double

* Adds test_float

* Samples updated

* Fixes javadoc
2022-09-11 09:17:16 -07:00
William Cheng
928070c57a
Prepare 6.1.1 SNAPSHOT version (#13399)
* prepare v6.1.1

* update samples

* update doc
2022-09-11 19:08:23 +08:00
William Cheng
43dbb5ff9c
6.1.0 release (#13398) 2022-09-11 17:16:07 +08:00
Justin Black
c4d56afcae
[python-experimental] adds test verifying inheriting from multiple AnyType classes (#13358)
* Adds test_additional_properties_validator

* Updates test

* Reverts file
2022-09-05 17:18:51 -07:00
Justin Black
2c5eb54f11
[python-experimental] Improves additionalProperties processing when additionalProperties is unset (#13347)
* Adds NotAnyTypeSchema

* Unit test sample regenerated

* Turns parameter tests back on

* Removes unused from_server_types

* Reverts version files

* Samples regerated with fixed type hints

* Further fixed type hints
2022-09-05 13:17:48 -07:00
Justin Black
f139c090e5
[python-experimental] adds and uses regex patterns for json + filename detection (#13357)
* Unit test sample regenerated

* Reverts version files
2022-09-05 11:03:57 -07:00
Justin Black
cb8d9d5bfe
[python-experimental] adds new json content type (#13356)
* Adds json detection for application/json-patch+json

* Adds jsonPatch route and schemas

* Adds test_json_patch

* Unit test sample updated

* Reverts version files
2022-09-05 09:37:01 -07:00
Ahmed Fwela
2a8ea162d7
[dart-dio] handle polymorphism + discriminator serialization (#12295)
* return structured serializer

* generate samples

* implmented postProcessAllModels to fix assignment of inherited models

* Templates now respect inheritance

* regen dart samples

* only built value support for now

* ignore unused elements

* fixed tests

* new configs to test oneOf

* add some helper vendorextensions for oneOf support

* update templates

* regen samples

* resolve conflicts

* fix missing serializers

* Updated samples and fixed merge conflict

* updated samples

* Follow java conventions

* Follow java conventions

* updated samples

* update sampels 2

* update samples 3 ...

* fix underscores

* fixed missing imports from java code

* update config names

* updated samples

* updated built_value deps

* regen samples

* workaround built_value abstract builders google/built_value.dart#1180

* regen samples

* updated test pubspec

* temp fix rewriteImports for Lists and maps

* Add new samples to CI

* Improve white spaces & formatting

* fix enums not getting assigned correctly

* update samples

* fixed typo

* regen samples

* remove repeating imports

* regen samples

* ignore unused_element warning

* updated tests

* regen samples

Co-authored-by: Peter Leibiger <kuhnroyal@gmail.com>
2022-09-05 16:44:04 +08:00
Justin Black
5251a1b739
Adds isBooleanSchemaTrue/False getters and setters (#13341)
* Adds getters and setters for boolean schema true and false

* Updates CodegenModel

* Updates codegenProperty

* Updates codegenparameter and codegenresponse

* Adds comments describing the new properties

* Updates additionalProperty setting for python-experimental

* Sample regenerated

* Docs updated

* Do not write additionalProperties when they are unset

* Updates criteria for when DictSchema subcalsses are created

* Adds NotAnyTypeSchema when a schema is False

* Updates new kwargs signature

* Updates get_item type hints

* Updates sample, readme updated

* Simplifies method calls

* Adds get_item_oapg, removes unset from get_item and getattr

* Sample regenrated

* Fixes tests

* Raises AttributeError if a property is not required and it is dotname accessed

* Fixes one test

* Fixes 3 tests

* Fixes test

* Fixes two more tests

* Fixes test

* Fixes two tests

* Fixes two tests

* Tests fixed

* Unit test sample regerated, fixed unset addprops required type hint issue

* Migration guide updated

* Samples regenerated
2022-09-04 11:40:15 -07:00
Justin Black
62e28a27dd
[python-experimental] improves method names (#13325)
* Replaces all validate methods with public validate ones

* More methods made public with _oapg suffix

* Makes methods private where one can

* Fixes tests

* Fixes typo, maked Disciminable methods public

* Method changed to from_openapi_data_oapg

* Fixes tests for from_openapi_data_oapg

* Tweaks endpoint stub so the endpoint exists for ycharm type hints

* Makes Api methods protected

* Adds binary python type hints, makes get_new_instance_without_conversion_oapg public

* Protects some schema methods

* Protects more schema methods

* Renames as_x, is_x acessors with needed suffix

* Fixes some tests

* Fixes tests, fixes new signature for DateSchema

* Methods removed and made private

* Fixes indentation

* Samples regenerated
2022-09-01 00:34:05 -07:00
Justin Black
225204093f
[python-experimental] adds NullableX base class mixins, fixes additionalProperties type hint (#13323)
* Makes additionalProperties type hint include Unset

* Adds 2-class Mixins

* unit test sample regenerated

* Reverts version files
2022-08-31 12:16:53 -07:00
Justin Black
d63caf2539
[python-experimental] improves type hints of optional object properties (#13314)
* Adds Unset type hint for use cases containing additional properties

* Simplifies no addProps type hint template

* Unset type hints added when additionalProperties are off

* Adds __getitem__ unset fix

* Adds unset test

* Fixes non overload method when addprops are present

* Sample regenrated, tests added, readme updated

* Unit test sample updated

* Reverts version files
2022-08-30 16:44:30 -07:00
Justin Black
a294456695
[python-experimental] adds dict["key_name"] type hints (#13309)
* Uses frozendict module import in schemas and api_client

* Regnerates sample

* Adds overload type hints

* Adds __getitem__ methods for invalidly name properties

* Fixes code that instantiates referenced schemas in object payloads

* Fixes getitem literals containing control charaters

* Sorts params by required, adds type hints for properties with addProps turned off

* Unit test spec sample regenerated

* Adds stub files for models and endpoints

* Omitting some endpoint info from endpoint stub files

* Removes more from endpoint stub

* Deletes all except for schema definition in endpoint stubs

* Removes simple validations from stubs

* Removes endpoint parameter deifnition from endpoints stubs

* Removes unnecessary ../ stub variable access

* Samples regenerated

* Samples regenerated, fixed handling of invalidly named properties

* Samples regenerated

* Reverts version files
2022-08-30 11:51:31 -07:00
Justin Black
d97081e7dc
[python-experimental] improves type hints for arrays, and object required properties (#13299)
* Regenerates sample with additional enum values

* Sample regenerated, array type hints working

* Unit test sample regenerated

* Removes unneeded __getattribute__

* Sample regenerated using getRequiredVarsMap for property type hints

* Adds schemaFromAdditionalProperties to tell if a CodegenProperty is from properties or additionalProperties

* Adds get/setSchemaIsFromAdditionalProperties

* Updates codegenModel

* Updates codegenParameter

* Updates codegenResponse

* Uses setSchemaIsFromAdditionalProperties

* Fixes array new typ ehint and additional property type hints

* Samples regenerated

* Adds missing parms to javadoc

* Fixes param name

* Adds missing param to javadoc
2022-08-28 21:18:18 -07:00
Justin Black
fe934dc1b4
[python-experimental] improves type hints (#13271)
* Templates updated, dict properties moved into Meta

* Fixes tests

* Renames _discriminator to discriminator

* Moves required vars into required

* Renames _additional_properties to additional_properties

* Adds MetaOapgTyped

* Adds type hints for MetaOapg to classes that neen it

* Adds StrMixin

* Adds DecimalMixin

* Adds BoolMixin

* Adds NoneMixin

* Adds TupleMixin

* Adds FrozenDictMixin

* Regenerates unit test samples

* Only quotes type hints if they are imported

* Moves _items into Meta

* Renames _items to items, various small type hint fixes

* Adds type hints for object model new signature

* Adds type hints for body schema primitive types

* Adds primitive types to all query/path/header/cookie params

* Samples regenerated for unit test api

* Version files fixed
2022-08-26 07:09:08 -07:00
William Cheng
2e89004683 update go samples 2022-08-24 23:43:57 +08:00
jtvmatos
4f94d449dc
fix: Deepcopy fail for allOf schemas (#13130) 2022-08-23 23:07:37 -07:00
Justin Black
3f2b167360
[python-experimental] creates + uses MetaOapg cls to store non-properties schema keywords (#13256)
* Uses MetaOapg

* Fixes some tests

* Fixes tests

* Removes pass

* Generates unit test sample

* Samples regenerates

* Reverts version files

* Changes uniqueItems to Boolean type

* Samples regenerated

* Fixes code in addImportsForPropertyType

* Fixes codegenModel and codegenProperty

* Fixes CodegenParameter

* Adds getUniqueItemsBoolean/setUniqueItemsBoolean

* Updates template to use getUniqueItemsBoolean

* Adds printing of uniqueItemsBoolean in codegenModel

* Samples regenerated
2022-08-23 17:26:43 -07:00
Justin Black
d6fb08d837
[python-experimental] moves composed schemas into cls (#13255)
* Composed schemas moved into cls

* Fixes tests

* Other sample regenerated

* Reverts version files
2022-08-22 16:50:46 -07:00
Justin Black
fac576a2bf
[python-experimental] move validations into cls (#13252)
* Adds null checks to validation properties

* Modifies the templates to move validations into the cls

* Regnerates unit test spec

* Template update to get rid of cls factory for validations

* Updates samples for unit test spec

* Moves SchemaValidator class

* Removes SchemaValidator

* Fixes 2 tests in v3 sample

* Reverts version files

* Reverts 2 files
2022-08-22 15:34:48 -07:00
Justin Black
640010ad38
[python-experimental] style + naming cleanup (#13234)
* Updates templates

* Samples update

* Other sample updated

* Removes unserscore prefix from Validators

* Samples regenerated
2022-08-19 21:09:57 -07:00
Justin Black
52eb13f662
Standardizes import gathering code (#13137)
* Uses the same util to add all imports

* Removes unneeded class variable definition

* Samples regenerated for Groovy

* Fixes imports in Lua so object import does not show up

* Fixes nim imports

* Fixes proto generation

* Removes accidental new protobuf sample

* Improves proto allOf test

* Controls import addition with parametersAndResponsesImportFromV3SpecLocations

* More import protection in fromFormProperty

* More test fixes

* Samples regenerated

* Do not import composed schemas if those features are not supported

* Samples regenerated

* Adds new param importContainerType

* Fixes tests

* Samples regenerated

* Turns off importContainerType in JavaMicronautAbstractCodegen and regens samples

* Reverts most import changes, puts original imports behind a constant check

* Samples regenerated

* Updates model imports, samples regenerated

* Removes typeMapping and instantiationMap types from getImports

* Reverts template and regens samples

* Revers generator java files

* Stops setting complexType on codegenParameter

* Adds missing import back in

* Reverts languageSpecificPrimitives changes

* Samples regenerated

* Regnerates samples

* Reverts proto files

* Removes hoistParameterArrayItemBaseTypeHigher

* Samples regen

* Reverts parameter property

* Turns off importContainerType in getContent

* Samples regenerated

* Uncomments java test

* Adds imports for codegenParameter.schema

* Changes property name to importFromV3SpecLocations

* Changes property name to addSchemaImportsFromV3SpecLocations

* Removes unused java codes

* Fixes javadoc

* Removes extra docs file
2022-08-19 16:37:02 -07:00
Justin Black
3239f28e09
[python-experimental] code quality improvements (#13221)
* Changes http to https

* Refactors method to be simpler, removes unused json encoder

* Samples regen, test fixed, consolidated redundant return

* Samples regenerated

* Updates composed model property names

* Samples regenerated using composed schema name update

* Samples regen, removed unused arg in __get_oneof_class
2022-08-18 09:41:50 -07:00
Justin Black
b1dec24ae8
[python-experimental] improves docs, add migration guide (#13210)
* Adds comments and migration readme section

* Samples regenerated

* Samples regenerated
2022-08-17 14:27:02 -07:00
antssilva96
7e5ee2142c
Fixed regular expression in python client codegen that was removing any trailing chars instead of only expected ones (#13164)
* Fixed regular expression in python client codegen

The previous regular expression was too loose, including any last character in the second group. This commit fixes that, making sure we only remove leading forward slashes, trailing forward slashes or trailing `\i`.

This commit closes 13069.

* Added generated files

* Edit comment

* Add test cases

Co-authored-by: antonio.silva <antonio.silva@feedzai.com>
2022-08-16 09:06:53 -07:00
Noor Dawod
9d9e0a4335
Make "applyToParams" a Future + add "this." when decoding JSON (#13120)
* Bump jimschubert/query-tag-action from 1 to 2

Bumps [jimschubert/query-tag-action](https://github.com/jimschubert/query-tag-action) from 1 to 2.
- [Release notes](https://github.com/jimschubert/query-tag-action/releases)
- [Commits](https://github.com/jimschubert/query-tag-action/compare/v1...v2)

Signed-off-by: dependabot[bot] <support@github.com>

* Use a normal variable name inside a function, no need to make it private.

* Pass on authentication names because authentication implementations may need those!

* Generate Petstore samples.

* Allow authentication implementations to apply header and query parameters asynchronously.

* Allow inherited implementations to define a type for authentication class.

* Generate Petstore sources.

* Remove `authNames` from API client and authentication classes.

* Reference properties with `this.` in case one of them has the same name as a local variable.

* Regenerate Petstore source code.

* Revert adding a generic T in `ApiClient`.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-16 00:53:59 +08:00
devhl-labs
7e4fa70067
Update allOf to not always be nullable (#12861)
* added nonNullableVars

* added return property to operation

* added return property to operation

* build samples

* added inner enum

* build samples

* allOf no longer always nullable

* added a comment
2022-08-16 00:47:51 +08:00
Jacob Peterson
c987e75f92
Fix missing import in api.mustache for Typescript generator (#13105)
* Fix missing import in `api.mustache` for Typescript generator

This fixes issue OpenAPITools/openapi-generator#11288.

* Generate samples
2022-08-11 08:27:52 +02:00
William Cheng
1c0d6d84d8
[Go] Fix missing import for array/map of file (#13143)
* fix missing import for array/map of file in go client

* add new files
2022-08-10 16:26:10 +08:00
William Cheng
a6ce5f711b
Better logic to handle duplicated properties in parent, child models (#13135)
* better logic to handle duplicated properties in child, parent models

* add tests, update samples
2022-08-10 14:15:25 +08:00
Justin Black
9610a81a13
Adds requiredVarsMap (#13117)
* Adds requiredVarsMap

* Fixes imports

* Adds requiredVarsMap to CodegenParameter

* Updates CodegenResponse

* Adds feature to codegenModel

* Fixes codegenProperty

* Switches to getRequiredVarsMap

* Uses curly braces for set definition

* Added blocked examples back n to test spec now that the required bug is fixed

* Sample regenerated

* Handles escaping required property names

* Fixes CI tests

* Samples regenerated

* Samples regnerated

* Fixes test
2022-08-08 09:47:43 -07:00
RomainPruvostMHH
032e1a42d6
[Spring] Fix generated api ignore basePath (#10573)
* remove @RequestMapping from the apiController.mustache file and add it
to the api.mustache file

* move the defaultBasePath.mustache file in src/main/resources/JavaSpring
so that it commun with all Spring server-side libraries (spring-boot,
spring-mvc). The value of default context path is the value of
contextPath variable.

* added a unit test to verify it

* update the outputDir variable to samples/server/petstore/spring-stubs in
the  bin/configs/spring-stubs.yaml file because it generates Spring
server-side classes. And not on the client-side as the output directory
seemed to suggest.

* Results of "generate-samples.sh bin/configs/spring*" command

* Remove default value of url in @FeignClient

* resolve conflicts with origin/master

* merge remote/master into branch

* fix samples after a merge with master

* delete the directory samples/client/petstore/spring-stubs because it
moved to samples/openapi3/...

* add samples/client/petstore/spring-stubs just for the CI build (normally
it is unnecessary))

* delete 3 kotlin class files commited by error in
samples/server/petstore/kotlin-springboot and
samples/server/petstore/kotlin-springboot-reactive

* Update the unit test SpringCodegenTest.doAnnotateDatesOnModelParameters
because one more annotation is generated (@RequestMapping)

Co-authored-by: rpruvost <rpruvost@ITEM-S78402.emea.msad.sopra>
Co-authored-by: rpruvost <rpruvost@ITEM-S78402>
Co-authored-by: rpruvost <rpruvost>
2022-08-08 15:43:23 +08:00
Justin Black
aa1b0a15da
[python-experimental] removes print (#13107)
* Removes print

* Samples regenerated
2022-08-04 17:04:03 -07:00
Justin Black
8c3a734c64
[python-experimental] moves model and api docs into subfolders (#13106)
* Regens docs in new locations, adds endpoint anchors

* Updates readme links and top of page link

* Model updates so the readme links work

* Samples regenerated

* Adds missing module names to apis and models
2022-08-04 14:03:21 -07:00
Justin Black
69121a9b8f
3.0.3 spec updated with json schema tags (#13104)
* Spec updated with json schema tags

* Samples regenerated
2022-08-04 12:14:06 -07:00
Justin Black
a3490d7379
Revert "Issue 13043: converted an exception to a warning" (#13074)
* Revert "Issue 13043: converted an exception to a warning for doubly adding schemas to the includedSchemas list (#13070)"

This reverts commit bbf463f7275b69053345630c61444b909d6e345d.

* Samples regen
2022-08-03 13:22:32 -07:00