From b40bfd29bfbafa4515735fa36cabf664d6d97d8e Mon Sep 17 00:00:00 2001 From: Imransk3 Date: Fri, 7 Jul 2023 10:53:58 +0530 Subject: [PATCH 1/3] created dimension spec specification --- spec.yaml | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/spec.yaml b/spec.yaml index 7954660..ed7ce83 100644 --- a/spec.yaml +++ b/spec.yaml @@ -93,7 +93,79 @@ paths: description: "Something went wrong" schema: $ref: "#/definitions/generic_error" - + + /spec/dimension: + post: + tags: + - "spec" + summary: "Create a new dimension Specification" + description: "Add new dimension Specification" + operationId: "dimensionSpecification" + produces: + - "application/json" + parameters: + - in: "body" + name: "body" + required: true + schema: + example: + program: school + input: + type: object + properties: + school_id: + type: string + shouldNotNull: true + udise_code: + type: string + shouldNotNull: true + school_name: + type: string + shouldNotNull: true + schoolcategory_id: + type: string + shouldNotNull: true + block_id: + type: string + shouldNotNull: true + cluster_id: + type: string + shouldNotNull: true + cluster_name: + type: string + shouldNotNull: true + block_name: + type: string + shouldNotNull: true + district_id: + type: string + shouldNotNull: true + district_name: + type: string + shouldNotNull: true + latitude: + type: number + shouldNotNull: false + longitude: + type: number + shouldNotNull: false + + responses: + 200: + description: "Dimension Spec Created Successfully" + schema: + type: "object" + properties: + message: + type: "string" + example: "Dimension Spec Created Successfully" + dimension_name: + type: "string" + example: "school" + 400: + description: "Something went wrong" + schema: + $ref: "#/definitions/generic_error" /spec/schedule: post: From f90fa218d11f12b3a2c2b641ffb7c2b642281e6d Mon Sep 17 00:00:00 2001 From: dhanush-2397 Date: Fri, 7 Jul 2023 18:07:45 +0530 Subject: [PATCH 2/3] YAML changes --- spec.yaml | 343 +++++++++++++++++++++--------------------------------- 1 file changed, 135 insertions(+), 208 deletions(-) diff --git a/spec.yaml b/spec.yaml index ed7ce83..1a2dc0f 100644 --- a/spec.yaml +++ b/spec.yaml @@ -202,193 +202,143 @@ paths: description: "Something went wrong" schema: $ref: "#/definitions/generic_error" - /spec/grammar: - get: - tags: - - "spec" - summary: "" - description: "Create a schedule" - operationId: "Get spec" - produces: - - "application/json" - parameters: - - in: "query" - name: "grammar_type" - type: string - required: true - - in: "query" - name: "grammar_name" - type: string - required: true - - - - - responses: - 200: - description: "Grammar" - schema: - type: object - example: - schema: - type: object - properties: - date: - type: string - format: date - unique: true - school_id: - type: string - unique: true - students_attendance_marked: - type: integer - unique: true - - - - 400: - description: "No records found" - schema: - $ref: "#/definitions/generic_error" - - - /ingestion/event: - post: - tags: - - "ingestion" - summary: "Add Event into a CSV" - description: "Add event" - operationId: "addEvent" - produces: - - "application/json" - parameters: - - in: "body" - name: "body" - required: true - schema: - type: "object" - properties: - event_name: - type: "string" - example: "students_attendance" - event: - type: "array" - items: - type: "object" - properties: - date: - type: "string" - example: "2022-06-12" - school_id: - type: "number" - example: 1234567891 - grade: - type: "number" - example: 1 - gender: - type: "string" - example: "male" - total_students: - type: "number" - example: 10 - students_attendance_marked: - type: "number" - example: 8 - students_attendance_present: - type: "number" - example: 2 - responses: - 200: - description: "Event Added Successfully" - schema: - type: "object" - properties: - message: - type: "string" - example: "Event Added Successfully" - 400: - description: "Something went wrong" - schema: - $ref: "#/definitions/generic_error" - /ingestion/dimension: - post: - tags: - - "ingestion" - summary: "Add dimension into CSV" - description: "Add dimension" - operationId: "addDimension" - produces: - - "application/json" - parameters: - - in: "body" - name: "body" - required: true - schema: - type: "object" - properties: - dimension_name: - type: "string" - example: "school_details" - dimension: - type: "array" - items: - type: "object" - properties: - grade: - type: "number" - example: 1 - school_id: - type: "number" - example: 2402121120 - school_name: - type: "string" - example: "Tirthgam Pri. Sch" - school_type: - type: "string" - example: "rural" - school_category: - type: "string" - example: "primary" - cluster_id: - type: "number" - example: 240212111 - cluster_name: - type: "string" - example: "Sapreda" - block_id: - type: "number" - example: 24021 - block_name: - type: "string" - example: "Vav" - district_id: - type: "number" - example: 240 - district_name: - type: "string" - example: "Banaskantha" - state_id: - type: "number" - example: 1 - state_name: - type: "string" - example: "UP" - responses: - 200: - description: "Dimension Added Successfully" - schema: - type: "object" - properties: - message: - type: "string" - example: "Dimension Added Successfully" - 400: - description: "Something went wrong" - schema: - $ref: "#/definitions/generic_error" + # /ingestion/event: + # post: + # tags: + # - "ingestion" + # summary: "Add Event into a CSV" + # description: "Add event" + # operationId: "addEvent" + # produces: + # - "application/json" + # parameters: + # - in: "body" + # name: "body" + # required: true + # schema: + # type: "object" + # properties: + # event_name: + # type: "string" + # example: "students_attendance" + # event: + # type: "array" + # items: + # type: "object" + # properties: + # date: + # type: "string" + # example: "2022-06-12" + # school_id: + # type: "number" + # example: 1234567891 + # grade: + # type: "number" + # example: 1 + # gender: + # type: "string" + # example: "male" + # total_students: + # type: "number" + # example: 10 + # students_attendance_marked: + # type: "number" + # example: 8 + # students_attendance_present: + # type: "number" + # example: 2 + # responses: + # 200: + # description: "Event Added Successfully" + # schema: + # type: "object" + # properties: + # message: + # type: "string" + # example: "Event Added Successfully" + # 400: + # description: "Something went wrong" + # schema: + # $ref: "#/definitions/generic_error" + # /ingestion/dimension: + # post: + # tags: + # - "ingestion" + # summary: "Add dimension into CSV" + # description: "Add dimension" + # operationId: "addDimension" + # produces: + # - "application/json" + # parameters: + # - in: "body" + # name: "body" + # required: true + # schema: + # type: "object" + # properties: + # dimension_name: + # type: "string" + # example: "school_details" + # dimension: + # type: "array" + # items: + # type: "object" + # properties: + # grade: + # type: "number" + # example: 1 + # school_id: + # type: "number" + # example: 2402121120 + # school_name: + # type: "string" + # example: "Tirthgam Pri. Sch" + # school_type: + # type: "string" + # example: "rural" + # school_category: + # type: "string" + # example: "primary" + # cluster_id: + # type: "number" + # example: 240212111 + # cluster_name: + # type: "string" + # example: "Sapreda" + # block_id: + # type: "number" + # example: 24021 + # block_name: + # type: "string" + # example: "Vav" + # district_id: + # type: "number" + # example: 240 + # district_name: + # type: "string" + # example: "Banaskantha" + # state_id: + # type: "number" + # example: 1 + # state_name: + # type: "string" + # example: "UP" + # responses: + # 200: + # description: "Dimension Added Successfully" + # schema: + # type: "object" + # properties: + # message: + # type: "string" + # example: "Dimension Added Successfully" + # 400: + # description: "Something went wrong" + # schema: + # $ref: "#/definitions/generic_error" /ingestion/new_programs: post: @@ -515,30 +465,7 @@ paths: description: "Something went wrong" schema: $ref: "#/definitions/generic_error" - /ingestion/v4-data-emission: - get: - tags: - - "ingestion" - summary: "V4 data emission" - description: "V4 data emission" - operationId: "V4emission" - consumes: - - "multipart/form-data" - produces: - - "application/json" - responses: - 200: - description: "Files uploaded successfully" - schema: - type: "object" - properties: - message: - type: "string" - example: "Files uploaded successfully" - 400: - description: "Something went wrong" - schema: - $ref: "#/definitions/generic_error" + definitions: generic_error: From c76a354764983ecb43b532a1bd6db0b75ad36a6a Mon Sep 17 00:00:00 2001 From: Imransk3 Date: Fri, 7 Jul 2023 18:32:47 +0530 Subject: [PATCH 3/3] Added "Generate JWT" API endpoint to spec.yaml --- spec.yaml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/spec.yaml b/spec.yaml index ed7ce83..d2bcfe0 100644 --- a/spec.yaml +++ b/spec.yaml @@ -254,7 +254,32 @@ paths: schema: $ref: "#/definitions/generic_error" - + /ingestion/generatejwt: + get: + tags: + - 'ingestion' + summary: 'Generate JWT' + description: 'Generate a JWT token' + produces: + - 'application/json' + responses: + 200: + description: 'Token generated successfully' + schema: + type: 'object' + properties: + token: + type: 'string' + example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' + 400: + description: 'Error generating token' + schema: + type: 'object' + properties: + error: + type: 'string' + example: 'Could not generate token' + /ingestion/event: post: tags: