-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to disable validation in the API clients #5530
Comments
Hey @arun-nalla, I would like to know how to disable client_side_validation in python? I went through your changes. The changes belonged to openapi-generator. I don't know how swagger-codegen uses openapi-generator.
|
@subtleseeker the PR for swagger codegen is not merged yet. #9719 |
#9719 is merged - can this issue be closed? |
@sebastian-hatala-leanix it looks like this is fixed in master but not the 3.x branch. What's the procedure for tracking that? |
I tested this option out in the latest 2.x tag but was unable to make it work. Looking at the code, I don't think the Configuration object gets passed from the ApiClient to the instantiated model object. In this block of api_client.mustache, it instantiates the model object, passes kwargs into its constructor, but doesn't include self.configuration. It's fixed by changing line 624 to: I can create a PR, but I want to make sure I'm not being dumb and forgetting to set something. Has anyone else been able to disable the client-side validation? |
What's the status of this issue? I generated a python REST client via the swagger-codegen, but as stated by @spfjr, the configuration object is not passed to the models. Is this the correct way doing it? |
This fix is needed and resolves the problems I have. |
Description
Currently, there's no way to disable validation in the API clients and therefore we cannot use the API clients to perform integration tests with the RESTful backend (e.g. the API client cannot send requests with incorrect values as the client validation rule will fail the operation)
We'll introduce an option (e.g.
client_side_validation
in the configuration object)Swagger-codegen version
Latest master
Swagger declaration file content or url
Related issues
#5528 has been submitted for Ruby API client.
Suggest a Fix
If anyone wants to work on the enhancement, please reply to let us know.
The text was updated successfully, but these errors were encountered: