+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fd2cadf
json-lib: JSON Feature Proposal
alexandruiulian10 Apr 1, 2025
adf23df
json-lib: Fix typo in /docs/features/communication/json/index.rst
alexandruiulian10 Apr 1, 2025
008bb9b
json-lib: Rephrase JSON parser requirements to be more generic.
alexandruiulian10 Apr 11, 2025
ebf2209
json-lib: Move JSON Parser feature request to baselibs folder
alexandruiulian10 Apr 15, 2025
fd85fb6
json-lib: Rephrase some descriptions to be consistent with requirements
alexandruiulian10 May 7, 2025
6295864
json-lib: Remove unneeded linkage in JSON parser requrements
alexandruiulian10 May 7, 2025
0684f44
json-lib: Rename JSON Parser to JSON-Library
alexandruiulian10 May 9, 2025
70b96a9
json-lib: Rename requirement to stkh_req__communication__json_library
alexandruiulian10 May 15, 2025
08ea684
json-lib: Remove Feature flag section and correct deprecated flag
alexandruiulian10 May 16, 2025
a6b7550
Merge branch 'main' into json_feature_request
alexandruiulian10 Jun 18, 2025
9031dbd
json-lib: Redo requirements linkage.
alexandruiulian10 Jun 18, 2025
a9538d9
json-lib: Link additional feature requirements
alexandruiulian10 Jul 9, 2025
baa1bba
json-lib: Add type compatibility requirement.
alexandruiulian10 Jul 14, 2025
7bbe339
json-lib: Rewrite full testability requirement.
alexandruiulian10 Jul 16, 2025
5447d44
Merge branch 'eclipse-score:main' into json_feature_request
alexandruiulian10 Jul 21, 2025
2ef2a60
json-lib: Add requirement for returning data in user format
alexandruiulian10 Jul 21, 2025
3033850
Merge branch 'eclipse-score:main' into json_feature_request
alexandruiulian10 Jul 30, 2025
397f68e
json-lib: Move JSON component request files to modules folder
alexandruiulian10 Jul 30, 2025
0a44e59
json-lib: Rephrase comp_req__json__asil and add AOUs subsection
alexandruiulian10 Jul 30, 2025
422c752
json-lib: Rephrase comp_req__json__type_compatibility
alexandruiulian10 Aug 1, 2025
a1ad69d
json-lib: Add AOU requirements and small fixes
alexandruiulian10 Aug 1, 2025
6f99e11
Merge branch 'eclipse-score:main' into json_feature_request
alexandruiulian10 Aug 1, 2025
227cfcd
Merge branch 'eclipse-score:main' into json_feature_request
alexandruiulian10 Aug 7, 2025
96b083c
json-lib: Add optional future extensions.
alexandruiulian10 Aug 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/features/baselibs/docs/requirements/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,13 @@ Requirements
:status: valid

The base libraries shall adhere to secure coding standards to prevent vulnerabilities across platform components.

.. feat_req:: JSON-Library
:id: feat_req__baselibs__json_library
:reqtype: Functional
:security: NO
:safety: ASIL_B
:satisfies: stkh_req__functional_req__base_libraries
:status: valid

The base libraries shall provide a JSON-Library with parsing functionality.
113 changes: 109 additions & 4 deletions docs/modules/baselibs/json/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,117 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

.. _comp_doc_json:
JSON-Library
===========================

.. document:: JSON-Library
:id: doc__json
:status: valid
:safety: ASIL_B
:tags: component_request

json
####

.. toctree::
:hidden:

architecture/index
requirements/index.rst
architecture/index.rst


Abstract
========

This component request proposes the integration of a safe JSON-Library with parsing functionality.


Basic Functionality
----------------------
The component shall support parsing JSON data and convert that information to a compatible user format.


Future Extensions
----------------------
The component shall support a future extension for serializing from user format into JSON data.

Optional extensions which may be added if required:

* JSON schema validation.
* Compile-time parsing (used for test purposes to ensure that a component with errors cannot exist even in the absence of a pipeline).

Motivation
==========

S-CORE is targeting high-performance automotive systems with safety impact.
Some applications, like the IPC communication solution, require a safe JSON-Library with parsing functionality to enable loading of configuration information at runtime.
There is currently no solution for this inside S-CORE.

Rationale
=========

A JSON-Library with parsing functionality needs to be introduced in S-CORE software platform due to specific functional dependencies of different features (ex: IPC).

Further details are available in the following section:
.. _Specification:

Specification
=============

The following details and requirements describe the aspects of current feature in the context of S-CORE.

General considerations
----------------------

The JSON-Library should provide parsing and data conversion capabilities:

:need:`comp_req__json__validation`
:need:`comp_req__json__deserialization`
:need:`comp_req__json__user_format`

The component should be extensible in the future in order to support conversion of user format to JSON data.

User friendly API
-----------------

Programming languages have their own feature set and idioms.
It is crucial for any library that it seamlessly integrates into both.
This means, wherever possible and meaningful, infrastructure of the programming language and accompanying standard
libraries shall be reused.
Further, a developer used to the programming language shall have no problems understanding the API.
It should feel natural to use.
This includes error handling, which shall follow one of the error handling concepts of the programming language.

1. :need:`comp_req__json__lang_idioms`
2. :need:`comp_req__json__lang_infra`

Full testability for the public API
----------------------------------------

Our users will be required to proof certain coverage metrics, like line coverage or branch coverage.
For them to reach full coverage, they need to be easily able to mock or fake the public API of the JSON-Library in their unit tests.

:need:`comp_req__json__full_testability`

Backwards Compatibility
=======================

As there is currently no previous solution in S-CORE, no backwards compatibility is required.

Security Impact
===============

[How could a malicious user take advantage of this new/modified component?]

Safety Impact
=============

Overall, the component shall support use cases up to ASIL-B.

License Impact
==============

[How could the copyright impacted by the license of the new contribution?]

How to Teach This
=================

[How to teach users, new and experienced, how to apply the CR to their work.]
138 changes: 138 additions & 0 deletions docs/modules/baselibs/json/docs/requirements/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
..
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

Requirements
############

General Requirements
====================

.. comp_req:: JSON Validation
:id: comp_req__json__validation
:reqtype: Functional
:security: NO
:safety: ASIL_B
:satisfies: feat_req__baselibs__json_library
:status: valid

The JSON-Library shall provide a service to check the well-formedness of JSON data.

.. comp_req:: JSON Deserialization
:id: comp_req__json__deserialization
:reqtype: Functional
:security: NO
:safety: ASIL_B
:satisfies: feat_req__baselibs__json_library
:status: valid

The JSON-Library shall provide a service to parse JSON data according to RFC8259.

.. comp_req:: Return data in user format
:id: comp_req__json__user_format
:reqtype: Functional
:security: NO
:safety: ASIL_B
:satisfies: feat_req__baselibs__json_library
:status: valid

The JSON-Library shall return parsed data in a compatible user format.

Note: The user format shall be a regular type and not defined within the library.

User friendly API for information exchange
==========================================

.. comp_req:: Support for programming language idioms
:id: comp_req__json__lang_idioms
:reqtype: Non-Functional
:security: NO
:safety: ASIL_B
:satisfies: feat_req__baselibs__json_library, feat_req__baselibs__consistent_apis
:status: valid

The public API shall support the idioms of the programming language it is written in.

.. comp_req:: Use programming language infrastructure
:id: comp_req__json__lang_infra
:reqtype: Non-Functional
:security: NO
:safety: ASIL_B
:satisfies: feat_req__baselibs__json_library
:status: valid

The public API shall use core infrastructure of its programming language and accompanying standard libraries,
whenever possible and meaningful.

Note: This includes error handling.

.. comp_req:: Enforce strict type compatibility
:id: comp_req__json__type_compatibility
:reqtype: Functional
:security: NO
:safety: ASIL_B
:satisfies: feat_req__baselibs__json_library
:status: valid

The public API shall enforce strict type compatibility. When a user requests a value, the API shall
validate that the requested return type is compatible with the type and value of the stored JSON data.

Note: This includes checking if the stored value exceeds the range of the expected type.

Full testability for the user facing API
========================================

.. comp_req:: Fully testable public API
:id: comp_req__json__full_testability
:reqtype: Non-Functional
:security: NO
:safety: ASIL_B
:satisfies: feat_req__baselibs__json_library
:status: valid

The public API of the library shall support dependency injection with test doubles.

Note: This enables full testability of the user code.

Safety Impact
=============

.. comp_req:: JSON library ASIL level
:id: comp_req__json__asil
:reqtype: Functional
:security: NO
:safety: ASIL_B
:satisfies: feat_req__baselibs__json_library, feat_req__baselibs__safety
:status: valid

The JSON library shall be ASIL-B compliant.

AoU Requirements
=================
.. aou_req:: JSON data integrity
:id: aou_req__json__data_integrity
:reqtype: Non-Functional
:security: NO
:safety: ASIL_B
:status: valid

The integrity of input JSON data shall be ensured by the user.

.. aou_req:: Access control
:id: aou_req__json__access_control
:reqtype: Non-Functional
:security: NO
:safety: ASIL_B
:status: valid

Access control and manipulation prevention (e.g. dm-verity) shall be ensured by the hosting process and system configuration.
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载