-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix(license_patch): Fix bug in license patch request #50
Conversation
Signed-off-by: deo002 <[email protected]>
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.
Changes looks good.
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.
One question, rest looks good.
type LicensePOSTRequestJSONSchema struct { | ||
Shortname string `json:"rf_shortname" binding:"required" example:"MIT"` | ||
Fullname string `json:"rf_fullname" binding:"required" example:"MIT License"` | ||
Text string `json:"rf_text" binding:"required" example:"MIT License Text here"` | ||
Url string `json:"rf_url" binding:"required" example:"https://opensource.org/licenses/MIT"` | ||
Copyleft bool `json:"rf_copyleft" binding:"required"` | ||
FSFfree bool `json:"rf_FSFfree" binding:"required"` | ||
OSIapproved bool `json:"rf_OSIapproved" binding:"required"` | ||
GPLv2compatible bool `json:"rf_GPLv2compatible" binding:"required"` | ||
GPLv3compatible bool `json:"rf_GPLv3compatible" binding:"required"` | ||
Notes string `json:"rf_notes" example:"This license has been superseded." binding:"required"` | ||
Fedora string `json:"rf_Fedora" binding:"required"` | ||
TextUpdatable bool `json:"rf_text_updatable" binding:"required"` | ||
DetectorType int64 `json:"rf_detector_type" example:"1" binding:"required"` | ||
Active bool `json:"rf_active" binding:"required"` | ||
Source string `json:"rf_source" binding:"required"` | ||
SpdxId string `json:"rf_spdx_id" binding:"required" example:"MIT"` | ||
Risk int64 `json:"rf_risk" binding:"required"` | ||
Flag int64 `json:"rf_flag" binding:"required" example:"1"` | ||
Marydone bool `json:"marydone" binding:"required"` | ||
ExternalRef datatypes.JSONType[LicenseDBSchemaExtension] `json:"external_ref" binding:"required"` |
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.
I can see binding required in all the fields. Does that mean we cannot create a license without providing all the fields?
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.
Yes, while creating the license all the fields are required.
Resolves the following:
Example:
{
"active": false,
"text": "Lorem ipsum"
}
and
{
"text": "Lorem ipsum"
}
Structs of both these unmarshalled json objects will have active as false.