Skip to content
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(docs): Fix errors in compilation of docs of struct LicensePATCHRequestJSONSchema #55

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 65 additions & 13 deletions cmd/laas/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,71 @@ const docTemplate = `{
}
},
"models.LicensePATCHRequestJSONSchema": {
"type": "object"
"type": "object",
"properties": {
"marydone": {
"type": "boolean"
},
"rf_FSFfree": {
"type": "boolean"
},
"rf_Fedora": {
"type": "string"
},
"rf_GPLv2compatible": {
"type": "boolean"
},
"rf_GPLv3compatible": {
"type": "boolean"
},
"rf_OSIapproved": {
"type": "boolean"
},
"rf_active": {
"type": "boolean"
},
"rf_copyleft": {
"type": "boolean"
},
"rf_detector_type": {
"type": "integer",
"example": 1
},
"rf_flag": {
"type": "integer",
"example": 1
},
"rf_fullname": {
"type": "string",
"example": "MIT License"
},
"rf_notes": {
"type": "string",
"example": "This license has been superseded."
},
"rf_risk": {
"type": "integer",
"example": 3
},
"rf_source": {
"type": "string"
},
"rf_spdx_id": {
"type": "string",
"example": "MIT"
},
"rf_text": {
"type": "string",
"example": "MIT License Text here"
},
"rf_text_updatable": {
"type": "boolean"
},
"rf_url": {
"type": "string",
"example": "https://opensource.org/licenses/MIT"
}
}
},
"models.LicensePOSTRequestJSONSchema": {
"type": "object",
Expand Down Expand Up @@ -1929,18 +1993,6 @@ const docTemplate = `{
}
}
},
"models.OptionalData-string": {
"type": "object",
"properties": {
"isDefined": {
"description": "This is set to true if corresponding key is present in json object",
"type": "boolean"
},
"value": {
"type": "string"
}
}
},
"models.PaginationMeta": {
"type": "object",
"properties": {
Expand Down
78 changes: 65 additions & 13 deletions cmd/laas/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,71 @@
}
},
"models.LicensePATCHRequestJSONSchema": {
"type": "object"
"type": "object",
"properties": {
"marydone": {
"type": "boolean"
},
"rf_FSFfree": {
"type": "boolean"
},
"rf_Fedora": {
"type": "string"
},
"rf_GPLv2compatible": {
"type": "boolean"
},
"rf_GPLv3compatible": {
"type": "boolean"
},
"rf_OSIapproved": {
"type": "boolean"
},
"rf_active": {
"type": "boolean"
},
"rf_copyleft": {
"type": "boolean"
},
"rf_detector_type": {
"type": "integer",
"example": 1
},
"rf_flag": {
"type": "integer",
"example": 1
},
"rf_fullname": {
"type": "string",
"example": "MIT License"
},
"rf_notes": {
"type": "string",
"example": "This license has been superseded."
},
"rf_risk": {
"type": "integer",
"example": 3
},
"rf_source": {
"type": "string"
},
"rf_spdx_id": {
"type": "string",
"example": "MIT"
},
"rf_text": {
"type": "string",
"example": "MIT License Text here"
},
"rf_text_updatable": {
"type": "boolean"
},
"rf_url": {
"type": "string",
"example": "https://opensource.org/licenses/MIT"
}
}
},
"models.LicensePOSTRequestJSONSchema": {
"type": "object",
Expand Down Expand Up @@ -1922,18 +1986,6 @@
}
}
},
"models.OptionalData-string": {
"type": "object",
"properties": {
"isDefined": {
"description": "This is set to true if corresponding key is present in json object",
"type": "boolean"
},
"value": {
"type": "string"
}
}
},
"models.PaginationMeta": {
"type": "object",
"properties": {
Expand Down
53 changes: 45 additions & 8 deletions cmd/laas/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,51 @@ definitions:
type: array
type: object
models.LicensePATCHRequestJSONSchema:
properties:
marydone:
type: boolean
rf_FSFfree:
type: boolean
rf_Fedora:
type: string
rf_GPLv2compatible:
type: boolean
rf_GPLv3compatible:
type: boolean
rf_OSIapproved:
type: boolean
rf_active:
type: boolean
rf_copyleft:
type: boolean
rf_detector_type:
example: 1
type: integer
rf_flag:
example: 1
type: integer
rf_fullname:
example: MIT License
type: string
rf_notes:
example: This license has been superseded.
type: string
rf_risk:
example: 3
type: integer
rf_source:
type: string
rf_spdx_id:
example: MIT
type: string
rf_text:
example: MIT License Text here
type: string
rf_text_updatable:
type: boolean
rf_url:
example: https://opensource.org/licenses/MIT
type: string
type: object
models.LicensePOSTRequestJSONSchema:
properties:
Expand Down Expand Up @@ -427,14 +472,6 @@ definitions:
example: 200
type: integer
type: object
models.OptionalData-string:
properties:
isDefined:
description: This is set to true if corresponding key is present in json object
type: boolean
value:
type: string
type: object
models.PaginationMeta:
properties:
limit:
Expand Down
36 changes: 18 additions & 18 deletions pkg/models/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,24 @@ type LicenseJson struct {
// LicensePATCHRequestJSONSchema struct represents the input format for updating an existing license.
// Note that the license ID and shortname cannot be updated.
type LicensePATCHRequestJSONSchema struct {
Fullname OptionalData[string] `json:"rf_fullname" example:"MIT License"`
Text OptionalData[string] `json:"rf_text" example:"MIT License Text here"`
Url OptionalData[string] `json:"rf_url" example:"https://opensource.org/licenses/MIT"`
Copyleft OptionalData[bool] `json:"rf_copyleft"`
FSFfree OptionalData[bool] `json:"rf_FSFfree"`
OSIapproved OptionalData[bool] `json:"rf_OSIapproved"`
GPLv2compatible OptionalData[bool] `json:"rf_GPLv2compatible"`
GPLv3compatible OptionalData[bool] `json:"rf_GPLv3compatible"`
Notes OptionalData[string] `json:"rf_notes" example:"This license has been superseded."`
Fedora OptionalData[string] `json:"rf_Fedora"`
TextUpdatable OptionalData[bool] `json:"rf_text_updatable"`
DetectorType OptionalData[int64] `json:"rf_detector_type" example:"1"`
Active OptionalData[bool] `json:"rf_active"`
Source OptionalData[string] `json:"rf_source"`
SpdxId OptionalData[string] `json:"rf_spdx_id" example:"MIT"`
Risk OptionalData[int64] `json:"rf_risk"`
Flag OptionalData[int64] `json:"rf_flag" example:"1"`
Marydone OptionalData[bool] `json:"marydone"`
Fullname OptionalData[string] `json:"rf_fullname" swaggertype:"string" example:"MIT License"`
Text OptionalData[string] `json:"rf_text" swaggertype:"string" example:"MIT License Text here"`
Url OptionalData[string] `json:"rf_url" swaggertype:"string" example:"https://opensource.org/licenses/MIT"`
Copyleft OptionalData[bool] `json:"rf_copyleft" swaggertype:"boolean"`
FSFfree OptionalData[bool] `json:"rf_FSFfree" swaggertype:"boolean"`
OSIapproved OptionalData[bool] `json:"rf_OSIapproved" swaggertype:"boolean"`
GPLv2compatible OptionalData[bool] `json:"rf_GPLv2compatible" swaggertype:"boolean"`
GPLv3compatible OptionalData[bool] `json:"rf_GPLv3compatible" swaggertype:"boolean"`
Notes OptionalData[string] `json:"rf_notes" example:"This license has been superseded." swaggertype:"string"`
Fedora OptionalData[string] `json:"rf_Fedora" swaggertype:"string"`
TextUpdatable OptionalData[bool] `json:"rf_text_updatable" swaggertype:"boolean"`
DetectorType OptionalData[int64] `json:"rf_detector_type" example:"1" swaggertype:"integer"`
Active OptionalData[bool] `json:"rf_active" swaggertype:"boolean"`
Source OptionalData[string] `json:"rf_source" swaggertype:"string"`
SpdxId OptionalData[string] `json:"rf_spdx_id" example:"MIT" swaggertype:"string"`
Risk OptionalData[int64] `json:"rf_risk" swaggertype:"integer" example:"3"`
Flag OptionalData[int64] `json:"rf_flag" example:"1" swaggertype:"integer"`
Marydone OptionalData[bool] `json:"marydone" swaggertype:"boolean"`
}

// UpdateExternalRefsJSONPayload struct represents the external ref key value
Expand Down
Loading