Skip to content
This repository has been archived by the owner on Nov 13, 2018. It is now read-only.

TO: POST/PUT json body keys should be camelCase, not snake_case #1509

Closed
dangogh opened this issue Jun 8, 2016 · 11 comments
Closed

TO: POST/PUT json body keys should be camelCase, not snake_case #1509

dangogh opened this issue Jun 8, 2016 · 11 comments
Assignees
Milestone

Comments

@dangogh
Copy link
Contributor

dangogh commented Jun 8, 2016

the json body for all POST/PUT requests should have keys in camelCase and not snake_case. Most of these were added in #1142. This applies to POST and PUT on /servers, /deliveryservices, /profiles. /divisions, /regions, and /cachegroups (I think that's all of them...)

Example: POST .../api/1.2/servers will accept this json (from traffic_ops/t/api/1.2/server_create.t):

{
"host_name" => "tc1_ats2",
"domain_name" => "northbound.com",
"cachegroup" => "mid-northeast-group",
"cdn_name" => "cdn1",
"interface_name" => "eth0",
"ip_address" => "10.74.27.184",
"ip_netmask" => "255.255.255.0",
"ip_gateway" => "10.74.27.1",
"interface_mtu" => "1500",
"phys_location" => "HotAtlanta",
"type" => "MID",
"profile" => "MID1"
}

but it should look like this:

{
"hostName" => "tc1_ats2",
"domainName" => "northbound.com",
"cachegroup" => "mid-northeast-group",
"cdnName" => "cdn1",
"interfaceName" => "eth0",
"ipAddress" => "10.74.27.184",
"ipNetmask" => "255.255.255.0",
"ipGateway" => "10.74.27.1",
"interfaceMtu" => "1500",
"physLocation" => "HotAtlanta",
"type" => "MID",
"profile" => "MID1"
}

@limited
Copy link
Contributor

limited commented Jun 8, 2016

I think we already have a patch for this. Perhaps it just hasn't made its way into open source yet.

@dangogh
Copy link
Contributor Author

dangogh commented Jun 8, 2016

if that can make it's way in here, I'd really appreciate it.. thanks!

@dangogh dangogh added this to the 1.6.0 milestone Jun 9, 2016
@yorma
Copy link
Contributor

yorma commented Jun 12, 2016

My colleagues and I will work on this by different api, thanks.

@dangogh
Copy link
Contributor Author

dangogh commented Jun 13, 2016

Can you describe how you're planning to do that? I just want to make sure we know what's coming..

@yorma
Copy link
Contributor

yorma commented Jun 14, 2016

We plan to check APIs we pulled if the keys are snake_case, we will change to camelCase. It will be divided into tasks, so only 1 or 2 APIs in one pull request. We may start next week or the week after next week base on the timing. Thanks,

@mitchell852
Copy link
Member

keep in mind that release 1.6 will be cut on 6/30.

@dangogh
Copy link
Contributor Author

dangogh commented Jun 16, 2016

I put the 1.6 milestone on this -- is that reasonable? Would you expect to complete before 6/30 (with time for me to review..)? If not, let me know..

@jianli123
Copy link

Yes, we plan to fix it next week (by 6/28). Hope it match the 1.6 schedule. thanks

@dneuman64
Copy link
Member

Looks like this was referenced in 3 different PRs, is it resolved? Trying to audit open issues assigned to 1.6.

@dangogh
Copy link
Contributor Author

dangogh commented Jun 29, 2016

checking to see that all APIs were covered in the 3 PRs...

@dangogh
Copy link
Contributor Author

dangogh commented Jun 29, 2016

I think those 3 PRs cover it.. If any more are found, we should file a separate issue. I made a mistake in making this one too broad, so it required 3 PRs..

@dangogh dangogh closed this as completed Jun 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants