* chore: Remove leftover Github action file
This was probably added by mistake. A similar file is active in
.github/workflows/samples-python-pydantic-v1-petstore.yaml.
* chore: Remove leftover VERSION from old python-experimental sample
* ci: Stop running Python integration tests in Circle CI
These Python clients are all tested with Github Actions already, which
is faster, more cleanly separated and only runs on modifications.
I'm not cleaning up the pydantic-v1 client, I expect it to be removed soon anyway.
* chore: Remove true from sample folder name
python-disallowAdditionalPropertiesIfNotPresent-true
-> python-disallowAdditionalPropertiesIfNotPresent
* Uses ParseQuery to check for malform paramater value pairs.
Runs ./mvnw clean package, ./bin/generate-samples.sh ./bin/configs/*.yaml, and ./bin/utils/export_docs_generators.sh.
* Adds missing import
* Only import url if hasQueryParams.
* Adds helper function to wrap url.ParseQuery.
* Fixes function return signature
* 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 #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.
* 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
* fix: change indent style to tab in the mustache to generate Go code
* docs: standardize the language names for code blocks
* docs: change indent style to tab in the code blocks
* update: regenerate samples
* `./bin/generate-samples.sh ./bin/configs/*.yaml`
* Add optional parameter for request body
* Adapt Test
* Add test
* Format code
* Remove extra method
* Add optional for pojos
* Add optional for pojos
* Add bean validation for Optional
* Add default values + test
* Rename test
This was removed in #16802, but using a higher value than 1,
or at least making this configurable makes complete sense.
Without this, we get a lot of these log messages:
[ WARNING] Connection pool is full, discarding connection:
* Adds basic retries to API requests
* This mimics the basic retries performed by urllib3 in the sync version
* update samples
* Only use retry client if number of retries is specified in the config
* Reorganize
* Remove class attribute
* close retry_client
---------
Co-authored-by: William Cheng <wing328hk@gmail.com>
* Delete sample folders of discontinued clients
* Remove duplicate python-flask server sample
The python-flask sample actually lives in samples/server/petstore/python-flask.
* Move hand-written test to "tests" folder
Now, "test" only contains generated stubs and all hand-written tests are in "tests".
* Delete left-over files in Python samples
These are not created by the generators (anymore) and not hand-written
for testing.
* Regenerate test file to fix import error
* refactor: Clean up _response_types_map formatting
It matches black's behavior of having trailing commas now.
* test: Add test to reproduce #16967
* fix: deserialize responses even if no returnType
Closes#16967
* refactor: Simplify ApiException subclasses
* refactor: Move exception subtype choice to ApiException
* feat: Deserialize error responses and add to exceptions
* test: Add for error responses with model
For model classes with model_something fields, pydantic raises a warning by default:
`Field "model_something" has conflict with protected namespace "model_".`.
These warnings make no sense here, because most users of the generator have established APIs
that they cannot change to conform to pydantic's safety rules.
Pydantic will raise an error if we ever conflict with a current attribute like `model_dump`.
* [Server][Spring] support interface and implementation classes for API controllers
* Omitted new string calls
* Added Log messages
* remove else
* Removed redundant if
* Update missed ;