Skip to content

Commit

Permalink
Merge pull request #49 from siemens/obligation_data_fix_1
Browse files Browse the repository at this point in the history
fix(patch_obligation): Fix patch request bugs in obligation

Reviewed-by: [email protected], [email protected]
Tested-by: [email protected]
  • Loading branch information
GMishx authored Mar 29, 2024
2 parents 1236127 + 9ecd629 commit 13760df
Show file tree
Hide file tree
Showing 6 changed files with 425 additions and 341 deletions.
182 changes: 89 additions & 93 deletions cmd/laas/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.ObligationInput"
"$ref": "#/definitions/models.ObligationPOSTRequestJSONSchema"
}
}
],
Expand Down Expand Up @@ -989,7 +989,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.UpdateObligation"
"$ref": "#/definitions/models.ObligationPATCHRequestJSONSchema"
}
}
],
Expand Down Expand Up @@ -1682,29 +1682,27 @@ const docTemplate = `{
"white",
"yellow",
"red"
]
],
"example": "green"
},
"comment": {
"type": "string",
"example": "This is a comment."
"type": "string"
},
"id": {
"type": "integer",
"example": 147
},
"md5": {
"type": "string",
"example": "deadbeef"
},
"modifications": {
"type": "boolean"
"type": "boolean",
"example": true
},
"text": {
"type": "string",
"example": "Source code be made available when distributing the software."
},
"text_updatable": {
"type": "boolean"
"type": "boolean",
"example": true
},
"topic": {
"type": "string",
Expand All @@ -1717,17 +1715,50 @@ const docTemplate = `{
"restriction",
"risk",
"right"
],
"example": "risk"
}
}
},
"models.ObligationMapResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/models.ObligationMapUser"
}
},
"paginationmeta": {
"$ref": "#/definitions/models.PaginationMeta"
},
"status": {
"type": "integer",
"example": 200
}
}
},
"models.ObligationMapUser": {
"type": "object",
"properties": {
"shortnames": {
"type": "array",
"items": {
"type": "string"
},
"example": [
"GPL-2.0-only",
"GPL-2.0-or-later"
]
},
"topic": {
"type": "string",
"example": "copyleft"
}
}
},
"models.ObligationInput": {
"models.ObligationPATCHRequestJSONSchema": {
"type": "object",
"required": [
"text",
"topic",
"type"
],
"properties": {
"active": {
"type": "boolean",
Expand All @@ -1749,27 +1780,13 @@ const docTemplate = `{
"modifications": {
"type": "boolean"
},
"shortnames": {
"type": "array",
"items": {
"type": "string"
},
"example": [
"GPL-2.0-only",
"GPL-2.0-or-later"
]
},
"text": {
"type": "string",
"example": "Source code be made available when distributing the software."
},
"text_updatable": {
"type": "boolean"
},
"topic": {
"type": "string",
"example": "copyleft"
},
"type": {
"type": "string",
"enum": [
Expand All @@ -1781,27 +1798,38 @@ const docTemplate = `{
}
}
},
"models.ObligationMapResponse": {
"models.ObligationPOSTRequestJSONSchema": {
"type": "object",
"required": [
"active",
"classification",
"comment",
"modifications",
"shortnames",
"text",
"topic",
"type"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/models.ObligationMapUser"
}
"active": {
"type": "boolean",
"example": true
},
"paginationmeta": {
"$ref": "#/definitions/models.PaginationMeta"
"classification": {
"type": "string",
"enum": [
"green",
"white",
"yellow",
"red"
]
},
"comment": {
"type": "string"
},
"modifications": {
"type": "boolean"
},
"status": {
"type": "integer",
"example": 200
}
}
},
"models.ObligationMapUser": {
"type": "object",
"properties": {
"shortnames": {
"type": "array",
"items": {
Expand All @@ -1812,9 +1840,22 @@ const docTemplate = `{
"GPL-2.0-or-later"
]
},
"text": {
"type": "string",
"example": "Source code be made available when distributing the software."
},
"topic": {
"type": "string",
"example": "copyleft"
},
"type": {
"type": "string",
"enum": [
"obligation",
"restriction",
"risk",
"right"
]
}
}
},
Expand Down Expand Up @@ -1889,51 +1930,6 @@ const docTemplate = `{
}
}
},
"models.UpdateObligation": {
"type": "object",
"properties": {
"active": {
"type": "boolean",
"example": true
},
"classification": {
"type": "string",
"enum": [
"green",
"white",
"yellow",
"red"
]
},
"comment": {
"type": "string",
"example": "This is a comment."
},
"modifications": {
"type": "boolean"
},
"text": {
"type": "string",
"example": "Source code be made available when distributing the software."
},
"text_updatable": {
"type": "boolean"
},
"topic": {
"type": "string",
"example": "copyleft"
},
"type": {
"type": "string",
"enum": [
"obligation",
"restriction",
"risk",
"right"
]
}
}
},
"models.User": {
"type": "object",
"required": [
Expand Down
Loading

0 comments on commit 13760df

Please sign in to comment.