UNPKG

jswagger

Version:
2 lines (1 loc) 10.5 kB
{"swagger":"2.0","info":{"version":"1.0.0","title":"jswagger-test-api","description":"The API for the EatBacon IOT project"},"consumes":["application/json"],"produces":["application/json"],"paths":{"/devices":{"get":{"tags":["Device"],"description":"returns all registered devices","operationId":"getDevices","parameters":[{"in":"query","name":"skip","type":"integer","format":"int32","description":"number of records to skip"},{"in":"query","name":"limit","type":"integer","format":"int32","description":"max number of records to return"}],"responses":{"200":{"description":"All the devices","schema":{"type":"array","items":{"type":"string","format":"uri","example":"http://10.0.0.225:8080"}}}}},"post":{"tags":["Device"],"operationId":"register","parameters":[{"in":"body","name":"device","required":false,"schema":{"$ref":"#/definitions/DeviceRegistrationInfo"}}],"responses":{"200":{"description":"successfully registered device"}}}},"/test/many-types":{"get":{"tags":["TestApi"],"operationId":"getManyTypes","parameters":[{"name":"testInput","in":"body","required":true,"schema":{"$ref":"#/definitions/ManyTypes"}}],"responses":{"200":{"description":"normal response","schema":{"$ref":"#/definitions/ManyTypesApiResponse"}}}}},"/lighting/dimmers/{deviceId}/{value}":{"post":{"tags":["Z-Wave"],"operationId":"setDimmer","parameters":[{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"value","in":"path","required":true,"type":"integer","maximum":100.0,"minimum":0.0,"format":"int32"}],"responses":{"200":{"description":"response","schema":{"$ref":"#/definitions/ApiResponse"}}},"x-swagger-router-controller":"ZWave"}},"/lighting/dimmers/{deviceId}/{value}/timer/{timeunit}":{"post":{"tags":["Z-Wave"],"description":"sets a dimmer to a specific value on a timer","operationId":"setDimmerTimer","parameters":[{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"value","in":"path","required":true,"type":"integer","format":"int32"},{"name":"timeunit","in":"path","required":true,"type":"integer","format":"int32"},{"name":"units","in":"query","required":false,"type":"string","default":"milliseconds","enum":["seconds","minutes","milliseconds"]}],"responses":{"200":{"description":"response","schema":{"$ref":"#/definitions/ApiResponse"}}},"x-swagger-router-controller":"ZWave"}},"/lighting/switches/{deviceId}":{"get":{"tags":["Z-Wave"],"operationId":"getSwitchState","parameters":[{"name":"deviceId","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"response","schema":{"$ref":"#/definitions/DeviceState"}}},"x-swagger-router-controller":"ZWave"}},"/lighting/switches/{deviceId}/{value}":{"post":{"tags":["Z-Wave"],"operationId":"setSwitch","parameters":[{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"value","in":"path","required":true,"type":"string","enum":[true,false]}],"responses":{"200":{"description":"response","schema":{"$ref":"#/definitions/ApiResponse"}}},"x-swagger-router-controller":"ZWave"}},"/lighting/switches/{deviceId}/{value}/timer/{minutes}":{"post":{"tags":["Z-Wave"],"description":"sets a switch to a specific value on a timer","operationId":"setSwitchTimer","parameters":[{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"value","in":"path","required":true,"type":"string","enum":[true,false]},{"name":"minutes","in":"path","required":true,"type":"integer","format":"int32"}],"responses":{"200":{"description":"response","schema":{"$ref":"#/definitions/ApiResponse"}}},"x-swagger-router-controller":"ZWave"}},"/lightingSummary":{"get":{"tags":["Z-Wave"],"operationId":"getLightingSummary","parameters":[],"responses":{"200":{"description":"ok","schema":{"$ref":"#/definitions/LightingSummary"}}},"x-swagger-router-controller":"ZWave"}},"/temperature":{"get":{"tags":["Environment"],"operationId":"temperatureSummary","parameters":[],"responses":{"200":{"description":"ok","schema":{"$ref":"#/definitions/TemperatureSummary"}}},"x-swagger-router-controller":"Environment"}},"/temperature/forecast/{days}":{"get":{"tags":["Environment"],"operationId":"getForecast","parameters":[{"name":"days","in":"path","required":true,"type":"integer","format":"int32"}],"responses":{"200":{"description":"the forecast","schema":{"$ref":"#/definitions/ForecastResponse"}}},"x-swagger-router-controller":"Environment"}},"/temperature/{zoneId}":{"get":{"tags":["Environment"],"operationId":"getZoneTemperature","parameters":[{"name":"zoneId","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Zone temperature","schema":{"$ref":"#/definitions/TemperatueZoneStatus"}}},"x-swagger-router-controller":"Environment"}},"/temperature/{zoneId}/heater":{"get":{"tags":["Environment"],"description":"gets the state of the heater","operationId":"getHeaterState","parameters":[{"name":"zoneId","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"heater state","schema":{"$ref":"#/definitions/HeaterState"}}},"x-swagger-router-controller":"Environment"}},"/temperature/{zoneId}/heater/{state}":{"post":{"tags":["Environment"],"description":"turns the heater on or off","operationId":"setHeaterState","parameters":[{"name":"zoneId","in":"path","required":true,"type":"string"},{"name":"state","in":"path","required":true,"type":"string","enum":[false,true]}],"responses":{"200":{"description":"Status of the operation","schema":{"$ref":"#/definitions/ApiResponse"}}},"x-swagger-router-controller":"Environment"}},"/zones":{"get":{"tags":["Zones"],"operationId":"getZones","parameters":[],"responses":{"200":{"description":"ok","schema":{"type":"array","items":{"type":"string"}}}},"x-swagger-router-controller":"Zones"}},"/zones/{zoneId}/quiet":{"get":{"tags":["Zones"],"operationId":"quietZone","parameters":[{"name":"zoneId","in":"path","required":true,"type":"string","enum":["basement","first-floor","second-floor"]}],"responses":{"200":{"description":"ok"}},"x-swagger-router-controller":"Zones"}}},"definitions":{"ManyTypes":{"type":"object","description":"types test","properties":{"number32":{"type":"integer","format":"int32"},"number64":{"type":"integer","format":"int64"},"simpleText":{"type":"string"},"binaryText":{"type":"string","format":"byte"},"timestamp":{"type":"string","format":"date-time"}},"example":{"number32":123456789,"number64":2166572391,"simpleText":"hello world","binaryText":"\u0000\u0001\u0002ÿ","timestamp":"2020-05-09T07:15:01.391Z"}},"ManyTypesApiResponse":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string","example":"everything is ok"},"result":{"$ref":"#/definitions/ManyTypes"}}},"LightingSummary":{"type":"object","properties":{"zones":{"type":"array","items":{"$ref":"#/definitions/LightingZone"}},"zoneStatus":{"type":"array","items":{"$ref":"#/definitions/LightingZoneStatus"}}},"description":"ok"},"LightingZone":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"deviceId":{"type":"integer","format":"int32"},"deviceType":{"type":"string","enum":["dimmer","switch"]},"zone":{"type":"string"}}},"LightingZoneStatus":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"lastUpdate":{"type":"string","format":"date-time"},"level":{"type":"integer","format":"int32"}},"description":"the status of the lighting zone."},"TemperatureSummary":{"type":"object","properties":{"zones":{"type":"array","items":{"$ref":"#/definitions/TemperatureZone"}},"zoneStatus":{"type":"array","items":{"$ref":"#/definitions/TemperatueZoneStatus"}}},"description":"ok"},"TemperatureZone":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","format":"int32","description":"the unique identifier for the zone"},"name":{"type":"string"},"inputPosition":{"type":"integer","format":"int32"},"outputPosition":{"type":"integer","format":"int32"},"zone":{"type":"string"}},"description":"a single temperature zone"},"TemperatueZoneStatus":{"type":"object","required":["id","timestamp","value"],"properties":{"id":{"type":"string","description":"the unique identifier for the zone"},"name":{"type":"string","description":"the name of the zone"},"value":{"type":"number","format":"double","description":"the temperature in the zone"},"units":{"type":"string","description":"the temperature units","enum":["celsius","fahrenheit"],"default":"fahrenheit"},"timestamp":{"type":"string","format":"date-time","description":"the timestamp when the temperature was measured"}},"description":"status of a single zone"},"ApiResponse":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string","example":"everything is ok"}}},"HeaterState":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"}}},"DeviceState":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"lastUpdate":{"type":"string","format":"date-time"},"level":{"type":"integer","format":"int32"}}},"ForecastResponse":{"type":"object","properties":{"city":{"$ref":"#/definitions/City"},"values":{"type":"array","items":{"$ref":"#/definitions/Forecast"}}}},"Forecast":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"pressure":{"type":"number","format":"double"},"humidity":{"type":"integer","format":"int32"},"windSpeed":{"type":"number","format":"double"},"clouds":{"type":"integer","format":"int32"},"temperature":{"$ref":"#/definitions/ForecastTemperature"},"weather":{"$ref":"#/definitions/WeatherForecast"}}},"City":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"lat":{"type":"number","format":"double"},"lon":{"type":"number","format":"double"},"country":{"type":"string"}}},"ForecastTemperature":{"type":"object","properties":{"low":{"type":"number","format":"double"},"high":{"type":"number","format":"double"},"morning":{"type":"number","format":"double"},"day":{"type":"number","format":"double"},"evening":{"type":"number","format":"double"},"night":{"type":"number","format":"double"}}},"WeatherForecast":{"type":"object","properties":{"summary":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"}}},"DeviceRegistrationInfo":{"type":"object","properties":{"uri":{"type":"string","format":"uri","example":"http://10.0.0.220:8080"},"id":{"type":"string","format":"uuid","example":"0729a580-2240-11e6-9eb5-0002a5d5c51b"}}}},"host":"virtserver.swaggerhub.com","basePath":"/jc-lab/jswagger-test-api/1.0.0","schemes":["https"]}