When an example was specified for a property with the `date` format, it's example would be generated to something like `2024-01-01T00:00:00.000+00:00` or `Sat Jan 30 01:00:00 CET 2021`.
It's because the resolved type for a Date example is a DateSchema, and a DateSchema uses `java.util.Date` to represents the Date. Which gets printed using .toString() not in the YYYY-MM-dd format.
Fixes#17494#15342
* fix: ExampleGenerator correctly generates allOf composed schemas
Changes the previous behavior of generating `null` examples for allOf composed schemas.
Fixes#17497
* fix: ExampleGenerator correctly generates anyOf and oneOf composed schemas
Changes the previous behavior of generating `null` examples for anyOf and oneOf composed schemas.
To generate a oneOf/anyOf example, we generate the example using the first valid schema available. In case of a $ref, we use the first valid reference.
Fixes#17497
* python: adjust basic typing information
This is an initial pass to fix and adjust the typing information for the
generated client. This is enough to have mypy runnning without complains
on all the (modern) generated clients (Pydantic v1 code is not checked
for instance)
mypy is also now run directly in the CI, so further changes will also be
checked and thus, will need to be compliant with good typing
information.
Note that this doesn't *fully* type all the code: mypy is not run in
"strict" mode and there are still many functions/methods/attributes
which are still not fully typed, but it's a first good step in that
direction.
* ApiResponse's raw_data can't be None
* Fix indentation
* Revert test changes
* run mypy on tests/ directory
* don't forcefully convert the client response headers to dict
* override petstore ApiResponse model
* adjust type of 'any/one_of_schemas' fields
* fix #16797 and #15796 spring child constructor missing parent params
* root cause and update the DefaultCodegen.java to add missing property when with multi inheritance
* rollback SpringCodegen.java
* update samples
* rollback with master cause #16992 fixed this issue too
* still using orignal design
* catchup master
* catchup master
* catchup master
* fix
* add tests
---------
Co-authored-by: dabdirb <dabdirb@gmail.com>
in rest template, when the retry limits exceeded
rethrow the original exception
also add 429 (Too many requests) status code to the
retry logic
fix#17478
In #16624, I introduced a new mechanism to record imports to other
modules, instead of having specialized datetime/typing/pydantic objects
to manage imports for these modules.
This change reuses the mechanism from #16624 and replace the specialized
import managers by the generic one. Unused imports from various
.mustache templates are also cleaned up.
* also escape '$' and '\' in normal Kotlin strings, …
* rename `lambdaEscapeDoubleQuote` to `lambdaEscapeInNormalString`
* escape `$` and `\` in `@RequestMapping` annotation `value` property
* Fix decoding OpenAPIDateWithoutTime which in previous implementation only worked when used with CodableHelper, because it encoded to String, but tried to decode from Date afterwards
* update samples
* Update OpenAPIDateWithoutTime.mustache
* Update sample projects
---------
Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Bruno Coelho <4brunu@users.noreply.github.com>
Co-authored-by: Bruno Coelho <4brunu@gmail.com>
* updating test to use the Java RESTEasy echo api client (#17367)
* regenerated samples
* set source and target to 1.8 to fix workflow failure, adapted parser
* update template for required field validation when additional properties are not allowed
* regenerate samples
* move bytes import from template to GoClientCodegen
* regenerate samples
* add test for model with required fields and additionalProperties: false