Skip to content

Commit

Permalink
Merge pull request #3359 from dougm/json-case
Browse files Browse the repository at this point in the history
govc: json tag camelCase fixes
  • Loading branch information
dougm committed Feb 8, 2024
2 parents 759d9a8 + 9ddfc53 commit 5d7849f
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 99 deletions.
2 changes: 1 addition & 1 deletion gen/gen_from_vmodl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def dump(io)
case @data["wsdl_base"]
when nil, "ManagedObject", "View"
include_ref_getter = true
io.print "Self types.ManagedObjectReference\n\n"
io.print "Self types.ManagedObjectReference `json:\"self\"`\n\n"
else
io.print "%s\n\n" % @data["wsdl_base"]
if @data["wsdl_base"] == "ManagedEntity"
Expand Down
2 changes: 1 addition & 1 deletion govc/device/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (d *infoDevice) MarshalJSON() ([]byte, error) {

// TODO: make use of "inline" tag if it comes to be: https://github.com/golang/go/issues/6213

return append([]byte(fmt.Sprintf(`{"Name":"%s","Type":"%s",`, d.Name, d.Type)), b[1:]...), err
return append([]byte(fmt.Sprintf(`{"name":"%s","type":"%s",`, d.Name, d.Type)), b[1:]...), err
}

type infoResult struct {
Expand Down
2 changes: 1 addition & 1 deletion govc/emacs/govc.el
Original file line number Diff line number Diff line change
Expand Up @@ -1503,7 +1503,7 @@ With prefix \\[universal-argument] ARG, launches an interactive console (VMRC)."
(defun govc-vm-extra-config ()
"Populate table with govc vm.info -e output."
(let* ((data (govc-json "vm.info" govc-args))
(vms (plist-get data :VirtualMachines))
(vms (plist-get data :virtualMachines))
(info))
(mapc
(lambda (vm)
Expand Down
12 changes: 6 additions & 6 deletions performance/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,10 @@ func (m *Manager) SampleByName(ctx context.Context, spec types.PerfQuerySpec, me

// MetricSeries contains the same data as types.PerfMetricIntSeries, but with the CounterId converted to Name.
type MetricSeries struct {
Name string
Name string `json:"name"`
unit string
Instance string
Value []int64
Instance string `json:"instance"`
Value []int64 `json:"value"`
}

func (s *MetricSeries) Format(val int64) string {
Expand All @@ -423,10 +423,10 @@ func (s *MetricSeries) ValueCSV() string {

// EntityMetric contains the same data as types.PerfEntityMetric, but with MetricSeries type for the Value field.
type EntityMetric struct {
Entity types.ManagedObjectReference
Entity types.ManagedObjectReference `json:"entity"`

SampleInfo []types.PerfSampleInfo
Value []MetricSeries
SampleInfo []types.PerfSampleInfo `json:"sampleInfo"`
Value []MetricSeries `json:"value"`
}

// SampleInfoCSV converts the SampleInfo field to a CSV string
Expand Down
Loading

0 comments on commit 5d7849f

Please sign in to comment.