Skip to content

Commit 1111abc

Browse files
authored
feat: put endpoint for POAM local-defs (#316)
* feat: put endpoint for local-defs Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com> * fix: copilot issues Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com> * fix: copilot issues Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com> --------- Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
1 parent 733b4e6 commit 1111abc

File tree

6 files changed

+762
-2
lines changed

6 files changed

+762
-2
lines changed

docs/docs.go

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10634,6 +10634,63 @@ const docTemplate = `{
1063410634
}
1063510635
}
1063610636
}
10637+
},
10638+
"put": {
10639+
"description": "Updates local-definitions for a given POA\u0026M with special handling of array and object fields.\n- Components and inventory-items arrays are treated as full replacements: the existing values on the POA\u0026M are overwritten by the arrays provided in the request body (no per-element merge is performed).\n- Sending an empty array [] for components or inventory-items clears that specific field (resulting in an empty array on the POA\u0026M).\n- Omitting a field in the request body leaves the existing value for that field unchanged.\n- Sending an empty JSON object {} as the payload deletes the entire local-definitions object for the POA\u0026M.",
10640+
"consumes": [
10641+
"application/json"
10642+
],
10643+
"produces": [
10644+
"application/json"
10645+
],
10646+
"tags": [
10647+
"Plan Of Action and Milestones"
10648+
],
10649+
"summary": "Update POA\u0026M local-definitions",
10650+
"parameters": [
10651+
{
10652+
"type": "string",
10653+
"description": "POA\u0026M ID",
10654+
"name": "id",
10655+
"in": "path",
10656+
"required": true
10657+
},
10658+
{
10659+
"description": "Local definitions data",
10660+
"name": "local-definitions",
10661+
"in": "body",
10662+
"required": true,
10663+
"schema": {
10664+
"$ref": "#/definitions/oscalTypes_1_1_3.PlanOfActionAndMilestonesLocalDefinitions"
10665+
}
10666+
}
10667+
],
10668+
"responses": {
10669+
"200": {
10670+
"description": "OK",
10671+
"schema": {
10672+
"$ref": "#/definitions/handler.GenericDataResponse-oscalTypes_1_1_3_PlanOfActionAndMilestonesLocalDefinitions"
10673+
}
10674+
},
10675+
"400": {
10676+
"description": "Bad Request",
10677+
"schema": {
10678+
"$ref": "#/definitions/api.Error"
10679+
}
10680+
},
10681+
"404": {
10682+
"description": "Not Found",
10683+
"schema": {
10684+
"$ref": "#/definitions/api.Error"
10685+
}
10686+
},
10687+
"500": {
10688+
"description": "Internal Server Error",
10689+
"schema": {
10690+
"$ref": "#/definitions/api.Error"
10691+
}
10692+
}
10693+
}
1063710694
}
1063810695
},
1063910696
"/oscal/plan-of-action-and-milestones/{id}/metadata": {

docs/swagger.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10628,6 +10628,63 @@
1062810628
}
1062910629
}
1063010630
}
10631+
},
10632+
"put": {
10633+
"description": "Updates local-definitions for a given POA\u0026M with special handling of array and object fields.\n- Components and inventory-items arrays are treated as full replacements: the existing values on the POA\u0026M are overwritten by the arrays provided in the request body (no per-element merge is performed).\n- Sending an empty array [] for components or inventory-items clears that specific field (resulting in an empty array on the POA\u0026M).\n- Omitting a field in the request body leaves the existing value for that field unchanged.\n- Sending an empty JSON object {} as the payload deletes the entire local-definitions object for the POA\u0026M.",
10634+
"consumes": [
10635+
"application/json"
10636+
],
10637+
"produces": [
10638+
"application/json"
10639+
],
10640+
"tags": [
10641+
"Plan Of Action and Milestones"
10642+
],
10643+
"summary": "Update POA\u0026M local-definitions",
10644+
"parameters": [
10645+
{
10646+
"type": "string",
10647+
"description": "POA\u0026M ID",
10648+
"name": "id",
10649+
"in": "path",
10650+
"required": true
10651+
},
10652+
{
10653+
"description": "Local definitions data",
10654+
"name": "local-definitions",
10655+
"in": "body",
10656+
"required": true,
10657+
"schema": {
10658+
"$ref": "#/definitions/oscalTypes_1_1_3.PlanOfActionAndMilestonesLocalDefinitions"
10659+
}
10660+
}
10661+
],
10662+
"responses": {
10663+
"200": {
10664+
"description": "OK",
10665+
"schema": {
10666+
"$ref": "#/definitions/handler.GenericDataResponse-oscalTypes_1_1_3_PlanOfActionAndMilestonesLocalDefinitions"
10667+
}
10668+
},
10669+
"400": {
10670+
"description": "Bad Request",
10671+
"schema": {
10672+
"$ref": "#/definitions/api.Error"
10673+
}
10674+
},
10675+
"404": {
10676+
"description": "Not Found",
10677+
"schema": {
10678+
"$ref": "#/definitions/api.Error"
10679+
}
10680+
},
10681+
"500": {
10682+
"description": "Internal Server Error",
10683+
"schema": {
10684+
"$ref": "#/definitions/api.Error"
10685+
}
10686+
}
10687+
}
1063110688
}
1063210689
},
1063310690
"/oscal/plan-of-action-and-milestones/{id}/metadata": {

docs/swagger.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12562,6 +12562,49 @@ paths:
1256212562
summary: Get POA&M local definitions
1256312563
tags:
1256412564
- Plan Of Action and Milestones
12565+
put:
12566+
consumes:
12567+
- application/json
12568+
description: |-
12569+
Updates local-definitions for a given POA&M with special handling of array and object fields.
12570+
- Components and inventory-items arrays are treated as full replacements: the existing values on the POA&M are overwritten by the arrays provided in the request body (no per-element merge is performed).
12571+
- Sending an empty array [] for components or inventory-items clears that specific field (resulting in an empty array on the POA&M).
12572+
- Omitting a field in the request body leaves the existing value for that field unchanged.
12573+
- Sending an empty JSON object {} as the payload deletes the entire local-definitions object for the POA&M.
12574+
parameters:
12575+
- description: POA&M ID
12576+
in: path
12577+
name: id
12578+
required: true
12579+
type: string
12580+
- description: Local definitions data
12581+
in: body
12582+
name: local-definitions
12583+
required: true
12584+
schema:
12585+
$ref: '#/definitions/oscalTypes_1_1_3.PlanOfActionAndMilestonesLocalDefinitions'
12586+
produces:
12587+
- application/json
12588+
responses:
12589+
"200":
12590+
description: OK
12591+
schema:
12592+
$ref: '#/definitions/handler.GenericDataResponse-oscalTypes_1_1_3_PlanOfActionAndMilestonesLocalDefinitions'
12593+
"400":
12594+
description: Bad Request
12595+
schema:
12596+
$ref: '#/definitions/api.Error'
12597+
"404":
12598+
description: Not Found
12599+
schema:
12600+
$ref: '#/definitions/api.Error'
12601+
"500":
12602+
description: Internal Server Error
12603+
schema:
12604+
$ref: '#/definitions/api.Error'
12605+
summary: Update POA&M local-definitions
12606+
tags:
12607+
- Plan Of Action and Milestones
1256512608
/oscal/plan-of-action-and-milestones/{id}/metadata:
1256612609
get:
1256712610
description: Retrieves metadata for a given POA&M.

0 commit comments

Comments
 (0)