Skip to content

Commit

Permalink
Add util module with function to build JSON schema
Browse files Browse the repository at this point in the history
Add JSON schema for all models
  • Loading branch information
NeonDaniel committed Oct 31, 2024
1 parent 3c51ca2 commit 0fbdc8f
Show file tree
Hide file tree
Showing 40 changed files with 4,248 additions and 0 deletions.
20 changes: 20 additions & 0 deletions neon_data_models/schema/api/node_v1/AudioInputData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"properties": {
"audio_data": {
"description": "base64-encoded audio",
"title": "Audio Data",
"type": "string"
},
"lang": {
"description": "BCP-47 language code",
"title": "Lang",
"type": "string"
}
},
"required": [
"audio_data",
"lang"
],
"title": "AudioInputData",
"type": "object"
}
23 changes: 23 additions & 0 deletions neon_data_models/schema/api/node_v1/CoreAlertExpired.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"properties": {
"msg_type": {
"default": "neon.alert_expired",
"title": "Msg Type",
"type": "string"
},
"data": {
"title": "Data",
"type": "object"
},
"context": {
"title": "Context",
"type": "object"
}
},
"required": [
"data",
"context"
],
"title": "CoreAlertExpired",
"type": "object"
}
23 changes: 23 additions & 0 deletions neon_data_models/schema/api/node_v1/CoreClearData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"properties": {
"msg_type": {
"default": "neon.clear_data",
"title": "Msg Type",
"type": "string"
},
"data": {
"title": "Data",
"type": "object"
},
"context": {
"title": "Context",
"type": "object"
}
},
"required": [
"data",
"context"
],
"title": "CoreClearData",
"type": "object"
}
23 changes: 23 additions & 0 deletions neon_data_models/schema/api/node_v1/CoreErrorResponse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"properties": {
"msg_type": {
"default": "klat.error",
"title": "Msg Type",
"type": "string"
},
"data": {
"title": "Data",
"type": "object"
},
"context": {
"title": "Context",
"type": "object"
}
},
"required": [
"data",
"context"
],
"title": "CoreErrorResponse",
"type": "object"
}
23 changes: 23 additions & 0 deletions neon_data_models/schema/api/node_v1/CoreIntentFailure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"properties": {
"msg_type": {
"default": "complete.intent.failure",
"title": "Msg Type",
"type": "string"
},
"data": {
"title": "Data",
"type": "object"
},
"context": {
"title": "Context",
"type": "object"
}
},
"required": [
"data",
"context"
],
"title": "CoreIntentFailure",
"type": "object"
}
23 changes: 23 additions & 0 deletions neon_data_models/schema/api/node_v1/CoreWWDetected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"properties": {
"msg_type": {
"default": "neon.ww_detected",
"title": "Msg Type",
"type": "string"
},
"data": {
"title": "Data",
"type": "object"
},
"context": {
"title": "Context",
"type": "object"
}
},
"required": [
"data",
"context"
],
"title": "CoreWWDetected",
"type": "object"
}
18 changes: 18 additions & 0 deletions neon_data_models/schema/api/node_v1/KlatResponse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"properties": {
"sentence": {
"description": "Text response",
"title": "Sentence",
"type": "string"
},
"audio": {
"title": "Audio",
"type": "object"
}
},
"required": [
"sentence"
],
"title": "KlatResponse",
"type": "object"
}
10 changes: 10 additions & 0 deletions neon_data_models/schema/api/node_v1/KlatResponseData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"properties": {
"responses": {
"title": "Responses",
"type": "object"
}
},
"title": "KlatResponseData",
"type": "object"
}
218 changes: 218 additions & 0 deletions neon_data_models/schema/api/node_v1/NodeAudioInput.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
{
"$defs": {
"AudioInputData": {
"properties": {
"audio_data": {
"description": "base64-encoded audio",
"title": "Audio Data",
"type": "string"
},
"lang": {
"description": "BCP-47 language code",
"title": "Lang",
"type": "string"
}
},
"required": [
"audio_data",
"lang"
],
"title": "AudioInputData",
"type": "object"
},
"NodeData": {
"properties": {
"device_id": {
"title": "Device Id",
"type": "string"
},
"device_name": {
"default": "",
"title": "Device Name",
"type": "string"
},
"device_description": {
"default": "",
"title": "Device Description",
"type": "string"
},
"platform": {
"default": "",
"title": "Platform",
"type": "string"
},
"networking": {
"allOf": [
{
"$ref": "#/$defs/NodeNetworking"
}
],
"default": {
"local_ip": "127.0.0.1",
"public_ip": "",
"mac_address": ""
}
},
"software": {
"allOf": [
{
"$ref": "#/$defs/NodeSoftware"
}
],
"default": {
"operating_system": "",
"os_version": "",
"neon_packages": null
}
},
"location": {
"allOf": [
{
"$ref": "#/$defs/NodeLocation"
}
],
"default": {
"lat": null,
"lon": null,
"site_id": null
}
}
},
"title": "NodeData",
"type": "object"
},
"NodeInputContext": {
"properties": {
"node_data": {
"anyOf": [
{
"$ref": "#/$defs/NodeData"
},
{
"type": "null"
}
],
"description": "Node Data"
}
},
"required": [
"node_data"
],
"title": "NodeInputContext",
"type": "object"
},
"NodeLocation": {
"properties": {
"lat": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Lat"
},
"lon": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Lon"
},
"site_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Site Id"
}
},
"title": "NodeLocation",
"type": "object"
},
"NodeNetworking": {
"properties": {
"local_ip": {
"default": "127.0.0.1",
"title": "Local Ip",
"type": "string"
},
"public_ip": {
"default": "",
"title": "Public Ip",
"type": "string"
},
"mac_address": {
"default": "",
"title": "Mac Address",
"type": "string"
}
},
"title": "NodeNetworking",
"type": "object"
},
"NodeSoftware": {
"properties": {
"operating_system": {
"default": "",
"title": "Operating System",
"type": "string"
},
"os_version": {
"default": "",
"title": "Os Version",
"type": "string"
},
"neon_packages": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Neon Packages"
}
},
"title": "NodeSoftware",
"type": "object"
}
},
"properties": {
"msg_type": {
"default": "neon.audio_input",
"title": "Msg Type",
"type": "string"
},
"data": {
"$ref": "#/$defs/AudioInputData"
},
"context": {
"$ref": "#/$defs/NodeInputContext"
}
},
"required": [
"data",
"context"
],
"title": "NodeAudioInput",
"type": "object"
}
Loading

0 comments on commit 0fbdc8f

Please sign in to comment.