-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(license): add struct with types for licenses #5211
feat(license): add struct with types for licenses #5211
Conversation
@DmitriyLewen is this PR stale or do you intend to continue with it in the near future? |
Hello @lior-orca |
This PR is stale because it has been labeled with inactivity. |
Please check my comments in #5204 |
// MarshalJSON customizes the JSON encoding of Licenses. | ||
func (ll *Licenses) MarshalJSON() ([]byte, error) { | ||
return json.Marshal(ll.ToStringSlice()) | ||
} | ||
|
||
// UnmarshalJSON customizes the JSON decoding of License. | ||
func (ll *Licenses) UnmarshalJSON(data []byte) error { | ||
var stringLicenses []string | ||
if err := json.Unmarshal(data, &stringLicenses); err != nil { | ||
return err | ||
} | ||
licenses := Licenses{} | ||
for _, l := range stringLicenses { | ||
licenses = append(licenses, License{ | ||
Type: LicenseTypeName, | ||
Value: l, | ||
}) | ||
} | ||
|
||
*ll = licenses | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we don't need to save license types for convert
mode.
Hello @DmitriyLewen I would like to ask is there any estimation when this can be delivered ? My team is strongly interested in ignoring python packages by their paths as it was discussed under: #6117. Thank you in advance, Regards Rafał :) |
Hello @Rafcu90 This PR changes base structure (I mean |
This PR is stale because it has been labeled with inactivity. |
This PR is stale because it has been labeled with inactivity. |
Description
Add new
License
struct to exclude prefixes for licenses.TODO:
Related issues
License
field from python packaging #5204Related PRs
Checklist