-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Is your feature request related to a problem? Please describe.
Thank you for creating such a useful library. We're using it in the CycloneDX SBOM Rust implementation. One rough edge we've come across is that we want to be able to accept mostly-correct SPDX identifiers (e.g. the "MIT/Apache-2.0"
convention that's present in several crates), but we want to ensure that we're only producing valid SPDX expressions in our output, to maximize ecosystem tooling compatibility.
Describe the solution you'd like
It would be useful for the Expression
type that is generated via parse_mode
with ParseMode::LAX
to be able to output as a valid SPDX identifier. Currently, it stores the original string and just outputs that when to_string
is called. Changing the output to_string
would be a breaking change, so maybe there could be an additional function named render
or something similar?
Describe alternatives you've considered
Currently, we have a temporary solution that replaces /
with OR
, but a proper solution would be more robust.
Additional context
If this change is welcome, I might have time to implement this myself and submit a PR over the next few weeks.