Skip to content

Inconsistent JSON field names in Tree and TSMeta and Http RPCs #292

Open
nickman opened this Issue Mar 6, 2014 · 1 comment

2 participants

@nickman
nickman commented Mar 6, 2014

In Next branch, there are some inconsistent field names shared by classes and their corresponding HTTP RPCs which periodically cause failures.

Tree: The tree ID field is called "tree_id" and "treeId". Propose that "treeId" be standardized.
TSMeta: The display name is called "display_name" and "displayName". Propose that "displayName" be standardized.
TSMeta: The display name is called "data_type" and "dataType". Propose that "dataType" be standardized.

@manolama
OpenTSDB member
manolama commented Mar 6, 2014

The standard we've been trying to follow is:

  • All class fields are lower case and separated with an underscore for readability.
  • All class methods are camelCase

The getters are all camel case so when Jackson grabs an object for serialization to the API it will follow that convention. Otherwise we'd have to write getters like getDisplay_name() that look ugly (hopefully I've caught all those, there may be some floating around)

If you're referring to the URL key/value names, I went with the field names there because it makes it a little more readable when you have a long query. I could go either way on that and it probably wouldn't be difficult to change as I doubt many folks are using overrides (chime in if you're reading this!)

There are tools already using the JSON API so we can't change that so it would leave the field names to be changed. I like having the underscores but could go either way. This one is up to Tsuna.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.