Skip to content

Conversation

Ornella33
Copy link
Contributor

Merge registry and discovery service

Ornella33 and others added 30 commits March 25, 2025 13:07
This refactoring separates server functionalities (Discovery, Registries, Repositories) from the core SDK to improve modularity and maintainability.

Changes:
- Server is now a separate app
- Added an initial pyproject.toml for the server app
- Moved all server-related classes and functions from sdk to server
- Consolidated descriptor.py, submodel_descriptor.py, and aas_descriptor.py into a single server_model.py file
Create a static method for the `aas_class_parsers`
so that we can overload this method in
 `ServerAASFromJsonDecoder` and avoid code duplication by copy/paste `object_hook()`
Create a KEYS_TO_TYPE tuple with
top-level JSON keys and the corresponding SDK types.
By providing this tuple as a param for
`read_aas_json_file_into` we can reuse the method in
`read_server_aas_json_file_into`
and avoid code duplication
Create a class method `_get_aas_class_serializers` for the mapping in `default()`
so that we can overload `_get_aas_class_serializers`
in `ServerAASToJsonEncoder` and avoid code duplication by copy/paste `default()`
- Refactor `_create_dict()`
- Add `JSON_AAS_TOP_LEVEL_KEYS_TO_TYPES` in `_generic`
and use it for `_create_dict()`
Create a class method `_get_aas_class_serializers` for the mapping in `default()` and in `read_aas_json_file_into()`
- Use extended `JSON_AAS_TOP_LEVEL_KEYS_TO_TYPES` in
`read_server_aas_json_file_into`
In 'repository' we keep only AAS/Submodel/CD Repository App,
in `http_api_helpers` we keep all classes/funcs which
will be used across discovery/repository/registry apps
All response related from http_api_helpers.py
was moved to `response.py`
We created parent classes `BaseWSGIApp` and `ObjectStoreWSGIApp`
for discovery/registry/repository app classes.
Now we can reuse methods defined in parent classes
and avoid code duplication.
Move all classes from `response.py` to `base.py`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants