%REM Copyright 2022-2023 HCL America, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License %END REM Option Public Option Declare ' Modify use statement as appropriate for your environent to point to relative path Use "../../../src/VoltScriptJsonConverter" Class Laureate Public name as String Public share as String Sub setName(firstName as String, lastName as String) Me.name = firstName & " " & lastName End Sub End Class Sub Initialize Call sample1() End Sub Sub sample1() Dim json as String json = |[{"firstname": "Guglielmo", "surname": "Marconi", "share": "2"},{"firstname": "Ferdinand", "surname": "Braun", "share": "2"}]| Dim setterConverter as New JsonSetterConverter() Call setterConverter.forSetter("setName")._ withValueParam()._ withSiblingParam("surname", "") Dim helper as new JsonConversionHelper() Call helper.withCustomConverter("firstname", setterConverter) Call helper.failSilently() Dim laureates as Variant laureates = helper.fromJsonString(json, "Laureate", "deser-30") Print CStr(laureates(0).name) & " and " & Cstr(laureates(1).name) End Sub