V1 API additionalParams value should not be converted

Bug #1969704 reported by Ayumu Ueha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
Medium
Unassigned

Bug Description

[Problem]

In the V1 API, if "additionalParams" dict is included in the request body, the value will be converted from camelCase to snake_case as follows:

Example input body:
{
  "additionalParams": {
    "FirstKey": "FirstValue",
    "SecondKey": "SecondKey"
  }
}
--> converted body:
{
  "additional_params": {
    "first_key": "FirstValue",
    "second_key": "SecondKey"
  }
}

This "additionalParams"'s content is user-defined and should not be converted.

[Cause]

For example, `utils.convert_camelcase_to_snakecase` is called and convert request body when instantiate in current code [1].

[Fix proposal]

In the `utils.convert_camelcase_to_snakecase` function [2], change `additionalParams` so that no conversion is performed.

The `utils.convert_camelcase_to_snakecase` function [3] is similar, but in this case, change it so that it is not converted for `additional_params`.

Note that `additionalParams` and `additional_params` themselves require conversion.

[1] https://opendev.org/openstack/tacker/src/branch/master/tacker/api/vnflcm/v1/controller.py#L671-L684
[2] https://opendev.org/openstack/tacker/src/branch/master/tacker/common/utils.py#L351-L376
[3] https://opendev.org/openstack/tacker/src/branch/master/tacker/common/utils.py#L379-L434

Changed in tacker:
status: New → In Progress
Yasufumi Ogawa (yasufum)
Changed in tacker:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.opendev.org/c/openstack/tacker/+/838660
Committed: https://opendev.org/openstack/tacker/commit/0e68a316059a37909dc279bca5d2c0aab8c4f82d
Submitter: "Zuul (22348)"
Branch: master

commit 0e68a316059a37909dc279bca5d2c0aab8c4f82d
Author: Ayumu Ueha <email address hidden>
Date: Wed Apr 20 08:39:42 2022 +0000

    Change to not convert additionalParams of V1 API

    The value of additionalParams of request or response data that is
    user-defined data should not be converted during processing.
    This patch changes to not convert value of additionalParams in request
    or additional_params in response.

    Closes-Bug: #1969704
    Change-Id: Ie652adc521e2c56e8ea2e43a708c70ac623e17e5

Changed in tacker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 8.0.0.0rc1

This issue was fixed in the openstack/tacker 8.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.