Actions
Refactor #3866
closedAPI v1/v2 code duplication
Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Description
API v2 and v1 share a lot of code both in tests and controllers. Refactoring the controllers is going to be somewhat complicated, but the tests are easy to refactor.
As an example, I compared hostgroups_controller for api v1 and v2 and the results are.. interesting.
https://gist.github.com/eLobato/7926170
The only difference here is literally 2 lines of code and the string V1 is replaced by V2. This same duplication happens at environments API controller and others. For every API controller that is duplicated in this way around 150 extra (duplicated) lines of code need to be maintained.
Updated by Dominic Cleal about 11 years ago
- Related to Feature #3017: API v2 - create separate controller for all objects rather than fallback to v1 added
Updated by Tomer Brisker about 7 years ago
- Status changed from New to Rejected
APIv1 will be dropped from core in #11389 along with the duplication. Closing.
Actions