:Release Notes:
:Detailed Notes:
- removed unused stack of fragments with associated tests
- escape_json_pointer changed to work with non-ASCIIz strings
- fixed compiler/gcc/builtins.h to be able included alone without others
- factored out uri_scope_get_uri_unsafe as access to top of uri_scope
with expectation that it present
:Testing Performed:
unit tests under desktop
:QA Notes:
:Issues Addressed:
[BHV-8631] libpbnjson: fix 'oneOf' behaviour for fragments without id's
Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Change-Id: Ic9256d8388b3ab35fd4b588cadb6c59864302570
Reviewed-on: https://g2g.palm.com/5797
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
:Release Notes:
Provide getType() method for JSON value.
:Detailed Notes:
Add getType() method to JValue class.
Add new method to unit tests.
:Testing Performed:
Unit tests
:QA Notes:
:Issues Addressed:
[BHV-36] pbnjson: Provide JSON value type in C++ API
Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>
Change-Id: Ib326b95df46d75bcd3d9647dbb4a29d6cf1ab3cc
Reviewed-on: https://g2g.palm.com/5224
Reviewed-by: DCO Verification
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
:Release Notes:
New API to parse schema from jvalue.
:Detailed Notes:
- tie together jtraverse and jschema_builder
- expose schema builder and parsing callbacks in public API
- add unit-tests for parsing schema from jvalue
:Testing Performed:
unit-tests
:QA Notes:
:Issues Addressed:
[BHV-3085] Provide pbnjson API for schema construction from jvalue
Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Change-Id: Ica96a9e7e6826487996e66e63785c49df2e6816c
Reviewed-on: https://g2g.palm.com/5145
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
:Release Notes:
Made a difference between jnull() and invalid value by introducing
jinvalid().
:Detailed Notes:
- added jis_valid to check answer for erroneous result
- extended jis_null to cover jinvalid() also
- jinvalid() returns JV_NULL value
:Testing Performed:
unit tests and performance test on desktop
:QA Notes:
:Issues Addressed:
[ANG-547] pbnjson: clash between error and null-value as result of jdom_parse
Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Change-Id: I85b57891976a4bd6a8ef4ed74fec99d8f0b816ec
Reviewed-on: https://g2g.palm.com/4538
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
:Release Notes:
Added calls of schemaInfo->m_errHandler's functions when validation
against schema failed in C API. Extended JValidation::isValid() API to
provide error handling. Added validation error calls on CPP parsing API.
:Detailed Notes:
:Testing Performed:
Unit tests with valgrind
:QA Notes:
:Issues Addressed:
[GF-43955] pbnjson: Provide information about validation error
Open-webOS-DCO-1.0-Signed-off-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Change-Id: Ic78b60c7baeed756089ec1f9bd3446c62fa4e8e1
Reviewed-on: https://g2g.palm.com/3874
Reviewed-by: Build Verification
Reviewed-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Tested-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Reviewed-by: Keith Derrick <keith.derrick@lge.com>
:Release Notes:
Remove previous schema implementation, remove useless tests.
Integrate new schema implementation, add temporary support for "extends"
and type "any". Deliver schema parsing errors somehow.
:Detailed Notes:
Legacy implementation was the bottle-neck for validation performance.
Since jvalue was validated during parsing and generation, it impacted
the performance drastically. The key problems of it were: parsing
schema into jvalue, then interpreting it allocating much memory even
without need.
New implementation on the other hand, parses JSON schema directly
into a dedicated hierarchical data structure Validator, which is aware
of validation. The validator is biased for fast validation in expense
of preprocessing during construction. Advanced techniques are used:
LALR(1) parser generation with LEMON, gperf for keyword recognition,
glib for basic containers implementation.
:Testing Performed:
Unit tests passed, unit tests with memory checker passed.
Smoke test on TV passed.
:QA Notes:
:Issues Addressed:
[GF-13496] pbnjson: Redesign validation against schema
[GF-35713] Make new validator compatible with the old one.
[GF-35717] Fix small issues after validator integration.
[GF-8140] Upgrade libpbnjson to YAJL-2
Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Change-Id: I890063e635b304e61ff9fc62e50e346eb4418dea
Reviewed-on: https://g2g.palm.com/3323
Reviewed-by: Build Verification
Reviewed-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Tested-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Keith Derrick <keith.derrick@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
:Release Notes:
Add C API jvalue_check_schema
Add CPP API JValidator::isValid
Remove a few low-level public C API
:Detailed Notes:
Add APIs to validate jvalue against schema
:Testing Performed:
Internal unit tests were extended to cover new functional
Internal unit tests were successully passed. Tests were run with
control of memory errors
:QA Notes:
:Issues Addressed:
[GF-2836] Validation of json objects against schemas in pbnjson
Open-webOS-DCO-1.0-Signed-off-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Change-Id: I0693cfe62e74e293453d45a9b72ec71b70cb8f87
Reviewed-on: https://g2g.palm.com/2854
Reviewed-by: Build Verification
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Tested-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
:Release Notes:
Check what is passed by the client code carefully to avoid
unexpected crashes.
Fix memory leaks in case of invalid operations on array and object.
:Detailed Notes:
Currently, assert() was used to check that arguments are in valid
ranges. But those asserts are compiled out in release builds and
thus ineffective for client applications. The library should use
explicit checks and error codes (or exceptions in C++) to inform
about incorrect arguments.
:Testing Performed:
Build succeeded.
:QA Notes:
:Issues Addressed:
[GF-8147] libpbnjson: Check and fix type information in all public API
Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Change-Id: Ie40055e4c825fa8838a01ddb3d055126b9fb6811
Reviewed-on: https://g2g.palm.com/2870
Reviewed-by: Build Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Keith Derrick <keith.derrick@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
:Release Notes:
Use GHashTable to keep key-value pairs of a JSON object
Use strong djb2 string hash function
Reduce jobject iterators to two functions
Fix automatic tests
Advance version to 2.0.0
:Detailed Notes:
The change is meant to improve the code clarity first of all.
The idea comes from cjson, which uses hash table with double-
linked elements for sequential iteration. JSON doesn't require
any particular order for object members, thus, GHashTableIter
will serve well.
Supposedly, the refactored code will perform better on
JSON object access, and sequential iteration. The performance
of parsing is roughly the same as of the previous implementation.
:Testing Performed:
Built successfully.
Ran automatic tests successfully.
Smoke tested on QEMU and on a real device.
:QA Notes:
The version of the component is 2.0.0 because of incompatible changes
to the JSON object iterators.
:Issues Addressed:
[GF-6969] libpbnjson: Refactor jobject to use GHashTable instead of m_buckets
Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Change-Id: I52fa62a9d6056353bb36945d9b5227b04429071d
Reviewed-on: https://g2g.palm.com/2828
Reviewed-by: Build Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
:Release Notes:
Add support of external references in JSON schema.
Add C API jvalue_tostring_schemainfo with support of external resolver.
:Detailed Notes:
The schema parser did not resolve external references, as a result
schema validation failed to validate fields from externals.
:Testing Performed:
Checked using internal unit tests
Starfih-image was built and checked on virtualbox
:QA Notes:
:Issues Addressed:
[GF-4639] pbnjson "$ref" and "extends" keywords not working
Open-webOS-DCO-1.0-Signed-off-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Change-Id: I6a6882efe42d2c3abaf576880e3a15c6762dcbfd
Reviewed-on: https://g2g.palm.com/2840
Reviewed-by: Build Verification
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Tested-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
:Release Notes:
Add another JGenerator::serialize without schema verification.
It allows to serialize JValue of any type eg. string, int, array, etc.
:Detailed Notes:
Current version of JGenerator::serialize provides json serialization with
schema verification. As a result simple json values, like string, int,
bool, can not be serialized due to the fact that there is no schema to
validate such json values. The new function will allow to serialize
JValue of any type.
:Testing Performed:
New unit test was implemented
:QA Notes:
:Issues Addressed:
[GF-8543] Provide one more JGenerator::serialize without schema verification
Open-webOS-DCO-1.0-Signed-off-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Change-Id: Ib27f353d88c2471e122c7fe4858bb6ca8531ae6d
Reviewed-on: https://g2g.palm.com/2811
Reviewed-by: Build Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Tested-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
:Release Notes:
Prohibit change of JValue object that is returned from JValue::operator[]
:Detailed Notes:
The json library has other interfaces to change the internal structure or values of JValue object.
Due to the fact that JValue is just a reference to a real json object, using of the bracket
operator can confuse users of the library.
:Testing Performed:
Starfish image was built to detect if other projects were not affected by the change.
It was tested using internal unit tests.
:QA Notes:
:Issues Addressed:
[GF-6380] libpbnjson: Assigning to array or object with bracket operator is not working
Open-webOS-DCO-1.0-Signed-off-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Change-Id: I932e30d1894d7e3ce20231fc36590709d5df01cc
Reviewed-on: https://g2g.palm.com/2809
Reviewed-by: Build Verification
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Tested-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
The JValue should be regarded as a shared_ptr, copies of which all
reference the same object. If a JSON value needs be cloned, it must be
stated explicitly.
[GF-4132] libpbnjson: original value is changed when copied
Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Change-Id: I0ec74271d93a98b9eb83381adf38c9f7638a8d22
JValue::operator==(const char *) was added in order to prevent C++ resolve const char * to bool.
[GF-6378]libpbnjson: JValue tries to compare C strings as booleans
Open-webOS-DCO-1.0-Signed-off-by: Alekseyev Oleksandr <oalekseyev@luxoft.com>
Change-Id: I6dc9013f31b4d011d3a3b39acc32e3a41ffdb509
One more api was added to perform object`s size calculation.
[GF-6379]libpbnjson: JValue::operator==(JValue) does not check objects' size
Open-webOS-DCO-1.0-Signed-off-by: Alekseyev Oleksandr <oalekseyev@luxoft.com>
Change-Id: I7100405fcad9ec9042dd98fe25cd0557e1f47ac0
Also removes NON_NULL from jvalue_copy and currently the NON_NULL in the
function definition causes the optimizer to remove all NULL checks from
that function, causing NULL dereferencing in worst case scenarios
[GF-6132] libpbnjson: Create unit tests for JValue
Open-webOS-DCO-1.0-Signed-off-by: Janne Hurskainen <janne.hurskainen@lge.com>
Change-Id: If0d78f995ff33d1e2b7e3247701a2ca8d69fa99d
UNEXPECTED_TYPE is added to ErrorType in schema, so it can be exported
out as sax errorstate
[GF-3835] sam needs more robust error reporting for app parsing errors
Open-webOS-DCO-1.0-Signed-off-by: DongHeon Jang <dongheon.jang@lge.com>
Change-Id: If40dfc06da7c28777687203294c3127039a7cf78
- detect pre yajl_version.h
- support for both yajl version
- use size_t in jtypes.h
Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <norluk@luxoft.com>
Change-Id: I0846ba87efb52f5ca326dd4ee5cb9d46e65c0d2c
Apparently it gets included implicitly when compiling with gcc 4.6.3 x86
but not when cross-compiling for ARM.
Open-webOS-DCO-1.0-Signed-off-by: Herb Kuta <herb.kuta@palm.com>
Change-Id: I5f010fb8f7583dd75299b0216e662b09622ee48f
Also add license blocks to files without them (except to JSON files, to
which they can't be added).
Open-webOS-DCO-1.0-Signed-off-by: Herb Kuta <herb.kuta@palm.com>
Change-Id: I2b9a36192dca2d09793b676d7cce71661ed52fef
- Move the public headers directory from src/api to include/public
to match the recommended source layout.
- WARNING: No content changes; a subsequent commit is required in order
for this component to be buildable
Change-Id: Ic4a55eadd5cad82297c9359492225f347902b511