neutron-lib: Redefine API validator
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Triaged
|
Wishlist
|
Hirofumi Ichihara |
Bug Description
The neutron-lib has API validator. I discussed proper behavior of API validator when I proposed dividing validators into base and specific validator[1].
Problem Description
===================
The validator of neutron-lib was just a package so we had to mix extension specific validator(e.g. validate_dns_name) with generic validators(e.g. validate_string and validate_boolean). Most validator cosumers don't need to import extension specific validator. Therefore, I proposed dividing validators patch[1]. However, the implementation is a little odd because all generic validators are in __init__.py although it's clearer that the validators package should be named another name(e.g. base.py, generic.py). And also the __init__.py still includes extension specific validators(e.g. validate_subports). We should divide such validator into another package.
In addition, there are some cases that the validator of neutron-lib is used directly[2, 3, 4] not as API validator. We should not use them directly. If we adopt API versioning, some validator change means the API version bump. It's better to prepare utility function for such use case.
So we have three points.
* Generic validator's place doesn't suit __init__.py.
* Some extension specific validators is still in __init__.py.
* API validator is used directly.
[1]: https:/
[2]: https:/
[3]: https:/
[4]: https:/
Changed in neutron: | |
status: | New → Triaged |
I'm not sure it's RFE but put the tag.