From dea04aec28991c3ea3690687491649b4762cf43c Mon Sep 17 00:00:00 2001 From: Sameen Fatima Date: Wed, 22 May 2024 03:15:56 +0500 Subject: [PATCH] fix: update allocate endpoint schema remove extra dashes --- api-compact.yaml | 42 +++++++++++++++++++++++++----------------- api.yaml | 44 ++++++++++++++++++++++++++------------------ 2 files changed, 51 insertions(+), 35 deletions(-) diff --git a/api-compact.yaml b/api-compact.yaml index 9df8e216..5882035b 100644 --- a/api-compact.yaml +++ b/api-compact.yaml @@ -84,6 +84,24 @@ definitions: items: type: "string" description: "assignment uuid" + PolicyAllocationRequestBody: + type: "object" + properties: + learner_emails: + type: "array" + description: "Learner emails to whom LearnerContentAssignments should be allocated." + required: true + items: + type: "string" + description: "email of a learner" + content_key: + type: "string" + description: "Course content_key to which these learners are assigned." + required: true + content_price_cents: + type: "integer" + description: "The price, in USD cents, of this content at the time of allocation. Must be >= 0." + required: true endpoints: v1: @@ -104,24 +122,14 @@ endpoints: type: string description: The uuid that uniquely identifies this policy record. required: true - - in: query - name: content_key - type: string - description: Course content_key to which these learners are assigned. - required: true - - in: query - name: content_price_cents - type: integer - description: The price, in USD cents, of this content at the time of allocation. - Must be >= 0. - required: true - - in: query - name: learner_emails - type: array - items: - type: string - description: Learner emails to whom LearnerContentAssignments should be allocated. + - name: "PolicyAllocationRequestBody" + in: "body" + description: "Contains learner emails, content keys and price" required: true + schema: + type: "array" + items: + $ref: "#/definitions/PolicyAllocationRequestBody" responses: *learner_content_assignment_allocate_responses x-amazon-apigateway-integration: responses: *apigateway_responses diff --git a/api.yaml b/api.yaml index c12b934f..32c3450d 100644 --- a/api.yaml +++ b/api.yaml @@ -66,6 +66,25 @@ definitions: items: type: string description: assignment uuid + PolicyAllocationRequestBody: + type: object + properties: + learner_emails: + type: array + description: Learner emails to whom LearnerContentAssignments should be allocated. + required: true + items: + type: string + description: email of a learner + content_key: + type: string + description: Course content_key to which these learners are assigned. + required: true + content_price_cents: + type: integer + description: The price, in USD cents, of this content at the time of allocation. + Must be >= 0. + required: true endpoints: v1: subsidyAccessPolicyAllocation: @@ -88,25 +107,14 @@ endpoints: type: string description: The uuid that uniquely identifies this policy record. required: true - - in: query - name: content_key - type: string - description: Course content_key to which these learners are assigned. - required: true - - in: query - name: content_price_cents - type: integer - description: The price, in USD cents, of this content at the time of allocation. - Must be >= 0. - required: true - - in: query - name: learner_emails - type: array - items: - type: string - description: Learner emails to whom LearnerContentAssignments should be - allocated. + - name: PolicyAllocationRequestBody + in: body + description: Contains learner emails, content keys and price required: true + schema: + type: array + items: + $ref: "#/definitions/PolicyAllocationRequestBody" responses: "202": description: Accepted