...
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user