5759 Commits

Author SHA1 Message Date
Jason Finch
dbb63dc077
tidy [csharp-netcore]: Remove unused UrlEncode method. Possible breaking change: Method is public so upstream consumer *may* of used it, but library does not. (#11453) 2022-02-07 15:18:24 +08:00
devhl-labs
8ecd619eb3
[csharp-nancyfx] Delete NancyFX (#11438)
* removed all nancyfx references

* didnt save one file

* removed two more nancyfx files
2022-02-07 15:06:47 +08:00
Julian G
9e1972bb1d
fix float literals in C++ Pistache codegen (#11483) 2022-02-07 12:21:11 +08:00
Ethan Keller
9f5422d688
Add cycle detection (#7532) (#11500)
* Add cycle detection (#7532)

* Review feedback

* Including ContextAwareNodes to detect cycles more accurately.

* Add test

* Add forest to test.

* No longer need ContextAwareNode

* Review feedback

* Update samples
2022-02-06 13:21:17 -05:00
cachescrubber
194b3fda26
[Bug][Java/Spring] OAS3 related bugfixes and enhancements (#11526)
* Content mediatype is hardcoded in api.mustache #11511

* Generate Samples

* OAS3 incorrect data type when providing a default value #11367

* Generate Samples

* Fix JsonTypeName annotation handling in Java and JavaSpring

* Generate Samples

* getIsClassnameSanitized: use null safe equals
2022-02-05 17:29:58 +08:00
zarlo
092100694e
Update __init__model.mustache (#11474)
fix a error in the template
2022-02-05 16:04:07 +08:00
William Cheng
e2d32b2061
fix javadoc warnings in feign client (#11527) 2022-02-05 15:18:36 +08:00
lbilger
1a14d9e5ca
Fix ClassCastException if expected type is Object (#11510)
The currently generated code will throw a `ClassCastException` if `type` is `Object`. I'm not quite sure why `isAssignableFrom` is used here but I tried to keep the change minimal - in my understanding, the result would be the same if the line was 
```
if(Types.getRawType(type).equals(ApiResponse.class)) {
``` 
because the `ApiResponse` only extends `Object` and implements no interfaces. Maybe it was meant to be `ApiResponse.class.isAssignableFrom(Types.getRawType(type))`? This would also permit subclasses of `ApiResponse`, but then it would be more complicated to determine the actual type parameter (because `type` itself may not be parameterized) and to create the object to return (because it would have to be an instance of the subclass).
2022-02-05 14:43:25 +08:00
ruijlpires
92ccb629e9
Fix duplicated Authorization headers when renewing a token on a retry (#11513)
Add a leeway time to avoid a skew in the local clock
2022-02-05 14:28:05 +08:00
Justin Black
6cf4e79f14
[python-experimental] adds missing bases, performance improvements (#11517)
* Adds bases for int32, int64, float32, and float64

* Samples updated

* Removes print statements

* When creating properties and items do not call _from_openapi_data or model __new__

* Update speed improvement

* cast_to_allowed_types speeed improvements

* _get_new_instance_without_conversion order swap for speed

* Fixes test errors

* Small fixes about path_to_schemas
2022-02-04 07:47:16 -08:00
y-tomida
7843a45b89
[TypeScript] Fix type array with uniqueItems (#11515)
* fix type mapping

* add missing primitive type Set

* add testcase

* generate new samples

* update typescript generator document

* regenerate samples and documents
2022-02-04 08:04:51 +01:00
Justin Black
4d9a500c95
Adds inline composition examples to python-experimental (#11420)
* Adds component with composition in property example

* Adds endpoint parameter examples

* Adds request body examples

* Adds inpline composition example in response body

* Fixes UNKNOWNBASETYPE import bug

* Updates allof inline schemas to be type object with minProperties

* Removes newline

* Adds test_ObjectWithInlineCompositionProperty

* Updates inline schema to be type string, adds partial test_inline_composition

* Fixes accept_content_types input value

* Adds test_ObjectWithInlineCompositionProperty, adds test_inline_composition and starts deserialization of multipart

* Fixes test_inline_composition, adds simple multipat/form-data deserialization
2022-02-03 08:27:52 -08:00
Bernd Hacker
dc1df25f29
[typescript-rxjs] add rxjs 7 support (#9958)
* feat(typescript-rxjs): add support for rxjs 7.2.0, use type imports

* feat(typescript-rxjs): regenerate samples

* feat(typescript-rxjs): use generic T instead of any in BaseAPI

* feat(typescript-rxjs): regenerate samples
2022-02-03 09:52:01 +01:00
Kasper Peulen
80082c73c4
Typescript-fetch: date is only converted to javascript date with runtime checks enabled (#11481)
* date is only converted to javascript date with runtime checks enabled

* fix test

* fix test
2022-02-02 07:50:45 +01:00
cghislai
95c996f866
Revert supports for delete body in typescript-angular client (#10976)
* Update generated angular 12 client version

* Revert "Delete body angular (#10751)"

This reverts commit edb88d919381d56a4ff885030f9b0e6f43b2898c.

* Update generated files
2022-01-31 07:53:07 +01:00
William Cheng
0e1164ff6b Merge remote-tracking branch 'origin/6.0.x' 2022-01-31 14:26:14 +08:00
William Cheng
4a36be7002
Prepare 5.4.0 release (#11457)
* prepare 5.4.0 release

* update gradle tests
2022-01-31 13:04:25 +08:00
cachescrubber
b261b29efb
[Java/Spring] Revert to fully qualified import for org.springframework.core.io.Resource (#11461)
* Revert to fully qualified import for org.springframework.core.io.Resource

* Generate Samples
2022-01-31 11:14:34 +08:00
Armel Soro
ed14ce4dec
[Kotlin] Use mutable container types when 'modelMutable' is enabled (#11154)
* [Kotlin] Use Mutable container types when 'modelMutable' is enabled

* Generate sample 'kotlin' project with mutable models

* Generate sample 'kotlin-server' project with mutable models

* Generate sample 'kotlin-vertx' project with mutable models

* Generate sample 'ktorm-schema' project with mutable models

Co-authored-by: Bruno Coelho <4brunu@users.noreply.github.com>
2022-01-30 12:06:03 +00:00
William Cheng
c8b84c4d03 Merge remote-tracking branch 'origin/master' into 6.0.x 2022-01-30 18:01:35 +08:00
William Cheng
3ed6343933
remove deprecated options in java client generator (#11456) 2022-01-30 15:57:02 +08:00
William Cheng
91087b59c5
remove swift4 generator (#11455) 2022-01-30 15:56:08 +08:00
William Cheng
8b017bc855
mark csharp-nancyfx generator as deprecated (#11454) 2022-01-30 15:53:27 +08:00
William Cheng
35fea62b3b
[c#][netcore] mark EOL frameworks as deprecated (#11450)
* removed old frameworks from csharp-netcore

* removed another reference and build samples

* updated readme

* deprecated frameworks

* fix test csproj file

* update doc

Co-authored-by: devhl-labs <shawnkanyer@gmail.com>
2022-01-30 02:01:26 +08:00
y-tomida
088c65c9c6
[typescript-axios] Add stringEnums option (#11368)
* add stringEnums option

* update templates

* add export

* update samples

* update document

* improve readability

* remove unnecessary code

* add config file for sample

* add sample

* update sample

* remove enum variable form modelObjetEnum template because this variable is not used in modelStringEnum template.

* change the indentation to be the same as modelGeneric template
2022-01-29 08:07:30 +01:00
William Cheng
b901f11e85
use encode_path instead in crystal (#11439) 2022-01-29 14:01:27 +08:00
Chao Yang
d8f70b3390
Fix crystal code gen null pointer exception error (#11437)
Checks if codegenParameter.items is null in constructExampleCode
2022-01-29 11:02:50 +08:00
Chao Yang
3f0f92fb65
[crystal][client] Make optional properties nillable in models (#10723)
* Add nillable data types to models

Only REQUIRED and NOT NULLABLE variables can NOT have type Nil
All OPTIONAL and NULLABLE-REQUIRED variables have type Nil
Only NULLABLE-REQUIRED variables should emit keys with null values when they are serialized, json example: property name : String? = nil; the json representation for this property is {"name": null}
For all OPTIONAL variables having Nil values, their variable keys would be skipped during serialization. The json representation for OPTIONAL property name : String? = nil;  would be: {}

* Fix failed tests in samples/client/petstore/crystal/spec/api/pet_api_spec.cr

* Remove isNullable from model template

* No need to check nillability of required property

For any required property, assigning nil value to it will result in compilation error
The datatype simply can not hold value nil, so there's no need to check it

* Place required vars first in initializor

* Refresh generated sample code for crystal client

* Required properties are not nillable

* Fix compilation error of undefined method equal?

Crystal lang doesn't have method equal?
We should use method same? instead of ruby's equal? method

Reference: https://crystal-lang.org/api/master/Reference.html#same?(other:Reference):Bool-instance-method

* Add tests for add_pet api endpoint with only required parameters

Setting Pet optional properties to nil values is allowed by add_pet api endpoint

* Add helper method to test compilation errors

* Add tests to Pet model

Test model initializations
Test compilation error when model is initialized without required properties

* Test required properties in json deserialization for Pet model
2022-01-29 10:55:44 +08:00
Antti Leppä
7dad57c8b6
[kotlin-server][jax-rs] Added support for JAX-RS library into Kotlin Server generator (#10830)
* Added templates for Kotlin JAX-RS server

* Fixed Kotlin Server JAX-RS template directory

* Added support for Kotlin Server JAX-RS library

* Added support using coroutines with Kotlin server JAX-RS library

* Added sample for Kotlin server JAX-RS library

* Added support for returnResponse option into Kotlin server JAX-RS library

* Fixed issue with optional parameters in Kotlin JAX-RS spec

* Fixed oneOf issue in Kotlin jaxrs-spec generator

* Added better documentation to Kotlin Server JAX-RS options

* Updated kotlin-server.md

* Updated kotlin-server jaxrs-spec samples

* Fixed issue with Kotlin JAX-RS spec and reserved names

* Regenerated samples
2022-01-29 10:37:51 +08:00
David Gamero
b2bb5d071e
[typescript] Adding Custom Agent Support for fetch call (#11400)
* add custom agent support

* samples

* more samples

* merge master files

* only enable custom agent on nodejs not browser

* samples again

* samples

* samples once more
2022-01-28 12:01:32 +01:00
devhl-labs
24366be0db
[csharp-netcore] Adding generic host library (#10627)
* added generichost library

* added templates

* added an event, improved docs, added logging

* adding event args file

* fixed hard coded package name

* added an AddTokens overload for a single token

* changed api clients to singletons to support the event registration

* build samples

* log exceptions while executing api responded event

* nrt bug fixes, dangling comma fix

* resolving comments

* removed debugging lines

* refactored token provider

* rate limit provider now default

* updated readme, added ConfigureAwait(false)

* DI fixes

* removed a hard coded project name

* fixed nrt bugs

* improved NRT and .net 3.1 support

* renamed projectName to apiName, added cli option

* trying to avoid conflict

* set GenerateAssemlbyInfo to true

* created docs/scripts folder

* moved ApiTestsBase.cs to not get overwritten

* test fixes and improvements

* fixed licenseId bug, updated readme

* build samples

* export docs

* removed new language features

* added support for .net standard 2.0

* added git_push.ps1

* fixed bug in git_push.sh due to the new directory, prompting user for commit message

* moved documentation folders

* fixed bug when apiKey in query

* bug fix
2022-01-28 12:05:36 +08:00
William Cheng
aed513f65d
[TS][nestjs] fix isListContainer with isArray (#11425)
* fix isListContainer with isArray in ts nextjs

* update samples
2022-01-28 10:56:30 +08:00
William Cheng
27d322de56
fix isArray, isMap tag in jaxrs spec templates (#11424) 2022-01-27 21:14:50 +08:00
grzegorz-moto
0bb08a7268
[kotlin] back ticks escaping of keywords and more (#11166)
* fix base class and back-ticks

* back-ticks in key word fix

* back-ticks fix in kotlin keywords

* samples

* remove EOL

Co-authored-by: ags039 <ags039@motorolasolutions.com>
2022-01-26 12:02:21 +00:00
feech
34395c3173
Makes the maven plugin to generate Model-tests and API-tests in generated-test-sources (#11294)
* added support for independent test-folder

* generate updated docs

* generate updated docs

* generate updated docs

* trigger a new CI builds

Co-authored-by: William Cheng <wing328hk@gmail.com>
2022-01-26 16:32:09 +08:00
William Cheng
604c1c0806
update jaxrs cxf, resteasy dependencies (#11414) 2022-01-26 16:23:41 +08:00
William Cheng
adcf04c63b
update jaxrs junit to newer version (#11410) 2022-01-26 15:40:24 +08:00
William Cheng
2ebadc36f7
update undertow dependencies (#11411) 2022-01-26 14:54:32 +08:00
Andriy Dmytruk
a0dd025c82
Add Micronaut server generator (#10270)
* Add micronaut server implementation

* Add micronaut server tests and imporovements

* Generate samples, docs and verify that tests pass

* Update micronaut docs and samples after merging with master

* Update micronaut dev server samples

* Add micronuat server docs

* Update micronaut version

* Minor changes to micronaut server and client

* Fix documentation generation in samples

Co-authored-by: Andriy Dmytruk <andriy.dmytruk@andriy.dmytruk.ca.oracle.com>
2022-01-26 13:51:19 +08:00
Jason Finch
066883be58
tidy: [csharp-netcore] Remove redundant useWebRequest tag from templates. (#11398) 2022-01-26 13:39:22 +08:00
jiangyuan
8b3cad0692
[Python] fix model to dict (#11234)
* fix model to dict

* add unit test

* add unit test

* update sample files
2022-01-25 09:50:59 -08:00
William Cheng
5d2a3698e2
[java][okttp-gson-nextgen] update docstring in ApiClient, RetryingOAuth (#11395)
* update docstring in apiclient, retryingoauth (java client)

* update samples
2022-01-25 17:04:32 +08:00
Justin Black
42f3258faa
Turns on python-experimental CI tests (#11390)
* Installs python3.9 in node3

* Moves python clients into separate node so they can use a docker image

* Installs java and maven into docker

* Switches off some python tests
2022-01-24 15:44:38 -08:00
Tim Quinn
6ac8d9b123
Change Helidon MP release in generated project from 1.x to 2.x (#11076)
* Support Helidon MP server using Helidon 2.4.1

Signed-off-by: tim.quinn@oracle.com <tim.quinn@oracle.com>

* Add unrelated changed sample file(s) after rebase

* Updated generated samples file after rebasing again

* Remove incorrectly 'git add'ed generated file
2022-01-24 17:22:50 +08:00
William Cheng
d91a2e4221 replace tabs with spaces 2022-01-24 17:10:24 +08:00
vanjur
7f07fa5ba0
[Python] Some regex patterns can generate invalid code. #6675 (#10920)
* fix issue 6675 & add javadoc

* fix formatting issue

* update JUnit test for 6675

* build & update samples for PR

* clean package and regenerating samples

* add progress for fix to issue 10957

* Revert "add progress for fix to issue 10957"

This reverts commit 8240c7ccb17141f7551ab34eda864ab4e068ebd8.

* fix version issues

* fix more versioning issues

* fix discrepancies with backslashes

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2022-01-24 16:38:19 +08:00
sullis
57e3ed2930
[java] JavaClientCodegenTest validateJavaSourceFiles (#11379) 2022-01-24 10:46:07 +08:00
sullis
e9d69f2b45
[java] javaparser 3.24.0 (#11382) 2022-01-24 10:42:27 +08:00
Justin Black
78f4748c06
Adds generator default template engine (#11366)
* Revert "Revert "Has generators set default template engine (#11245)" (#11316)"

This reverts commit 57987424a4eaa22d73337388489cd86d7f42a023.

* Only loads in the default template engine if the config file contains the generatorName

* Only sets templatingEngineName using condif default in one place

* Adds config files that lack generatorName

* Revert "Adds config files that lack generatorName"

This reverts commit 7dafc93c0f02c037d9be5d2c0a3ee7377c8b479d.

* Adds generator default templating engine to the generator metadata
2022-01-23 14:16:46 -08:00
David Gamero
28cc286265
[typescript] Default auth method support and optional param object when all params optional (#11321)
* add default auth

* private

* default when optional params and fix types

* build samples

* remove extra space

* re-add space before default empty

* switch to default authentication method support in config

* generated samples

* null check chaining

* generate samples

* remove extra spaces

* regen samples

* formatting fixes

* more samples

* remove from abstract methods

* samples

* add default to inversify as well

* samples again

* exclude inversify

* samples once more

* samples
2022-01-22 12:11:04 +01:00