问题
I need to use JSON in my Notes project. I've downloaded a library for it here https://openntf.org/main.nsf/project.xsp?r=project/JSON%20LotusScript%20Classes. I get a JSON String from back-end side, do some manipulations with JSON And later I need to parse it back into a String. But unfortunately, I can use either JSONReader
or JSONWrapperConverters
script. Cannot use both for some really stupid reason. It gives me the following error.
So I am able either to parse a string using JSONReader
or cast it back to a string using JSONWrapperConverters
. I need to do these 2 things together, obviously.. What is the problem? Why it cannot use 2 libraries at the same time?
回答1:
The problem was easy to solve as hell. JSONReader's comment
'use the JSONWrapperConverters instead of JSONArray and JSONObject if you need the ability to convert the JSONObject or JSONArray to a JSON string
'Use "ls.snapps.JSONWrapperConverters"
%REM
Copyright 2007, 2008, 2009, 2010 SNAPPS (Strategic Net Applications, 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
So just adding Use "ls.snapps.JSONWrapperConverters"
instead of
Use "ls.snapps.JSONArray"
Use "ls.snapps.JSONObject"
Solved the problem.
来源:https://stackoverflow.com/questions/49359123/why-i-cant-use-two-json-libraries-at-the-same-time-in-ls