This commit is contained in:
2025-07-19 15:54:23 +02:00
parent f092095e7b
commit 02ffc71aea
65 changed files with 2424 additions and 2165 deletions

View File

@@ -1,11 +1,14 @@
module openrpc
import json
import x.json2 { Any }
import freeflowuniverse.herolib.schemas.jsonschema { Reference, decode_schemaref }
pub fn decode(data string) !OpenRPC {
// mut object := json.decode[OpenRPC](data) or { return error('Failed to decode json\n=======\n${data}\n===========\n${err}') }
mut object := json.decode(OpenRPC,data) or { return error('Failed to decode json\n=======\n${data}\n===========\n${err}') }
mut object := json.decode(OpenRPC, data) or {
return error('Failed to decode json\n=======\n${data}\n===========\n${err}')
}
data_map := json2.raw_decode(data)!.as_map()
if 'components' in data_map {
object.components = decode_components(data_map) or {
@@ -17,7 +20,7 @@ pub fn decode(data string) !OpenRPC {
for i, method in methods_any.arr() {
method_map := method.as_map()
//TODO: I had to disable this because it was not working, need to check why !!!!!
// TODO: I had to disable this because it was not working, need to check why !!!!!
// if result_any := method_map['result'] {
// object.methods[i].result = decode_content_descriptor_ref(result_any.as_map()) or {