-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Deserialize(denormalize) JSON/XML documents to Python objects(data model) #185
Comments
Thanks for the feature request, @garethr . most important question for now: do you plan on implementing the feature yourself, or do you request it to be implemented? initial thoughts, that we could dicsuss, @madpah : FeasibilityThis library is feature complete regarding data models, having everything in place from 1.0 to 1.4 spec. Input validationWhen it comes to deserializing/denormalizing it is preferred to validate the input document(JSON/XML) first. Therefore a schema detection and a JSON/XML schema validator is required. possible implementation detailsto be discussed: architecture, design
|
@garethr - great idea, we should look into providing this. @jkowalleck - we're not 100% complete on schema coverage yet - see the following known open feature requests: |
I'm part of a team that also needs this feature. We started working on a parser, and would be happy to contribute something back that was better aligned to this team's vision. The biggest hurdle we experienced is inconsistent naming between model I'm a big fan of pydantic for handling serialization but I realize thats a bit of an architectural change. |
Thanks for joining the conversation @iandh. Let us take a look at your work and Thanks again! |
I would also be very happy if that feature would be available. Is there any progress on this issue? |
I would be interested in contributing / helping build towards such functionality - I think it should be doable to auto-generate the python classes based on the spec right? (e.g., https://github.com/CycloneDX/specification/blob/1.4/schema/bom-1.4.schema.json) @madpah happy to sync offline if you have started working on this already |
re: #185 (comment)
totally. if the input file was validated positive against the schema to use, then a generic/auto-generated code should work 👍 |
We did a similar exercise too and released it as hoppr_cyclonedx_models package to support Hoppr. There was some minor changes from what |
I would also be happy to contribute. I already created a loader cyclonedx_fileparser which is used in a private project. But this code is not complete, please see it as work in progress. |
Any status update on this? |
FWIW I found and looked at https://gitlab.com/hoppr/hoppr-cyclonedx-models/ by @iandh and @kirse and it looks like it fits the bill nicely for this feature. |
@pombredanne feel free to reach out if you experience any issues with hoppr-cyclonedx-models. We're using it pretty heavily over the last couple months and its stable. |
@iandh Thanks! FWIW we need to support this issue: aboutcode-org/scancode.io#583 |
The purpose of the hoppr-cyclonedx-models was to solve the same issue as the OP. |
Included in |
I'd like to be able to take existing CycloneDX documents, and work with them as Python objects. This library has the models, but I didn't see a
from_xml
orfrom_json
method or similar.This would make building tooling that consumes SBOMs much easier.
The text was updated successfully, but these errors were encountered: