levylabpitt / Instrument-Framework

An object-oriented framework for LabVIEW based on JKI SMOs.
BSD 3-Clause "New" or "Revised" License
4 stars 7 forks source link

API Style #91

Open ciozi137 opened 8 months ago

ciozi137 commented 8 months ago
  1. command/method should have no spaces. Example: setTemperature rather than Set Temperature
  2. parameter names should also be all lowercase, no spaces, and no units in the name. Example: temperature not Temperature (K)

old:

{
    "jsonrpc": "2.0",
    "method": "Set Magnet",
    "params": {
        "Field (T)": 0,
        "Rate (T/min)": 0,
        "Axis": "Z",
        "Mode": "Persistent"
    },
    "id": "5f33f29a28a3f2018034cefa8c763baf"
}

new:

{
    "jsonrpc": "2.0",
    "method": "setMagnetField",
    "params": {
        "field": 0,
        "rate": 0,
        "axis": "z",
        "mode": "persistent"
    },
    "id": "ac3caf5f75f9d4ed9b1bf5cd8a3812d2"
}