Blog Post

Below code was demonstrated in the following video: https://youtu.be/rkk2h6Tra9A

---

openapi: 3.0.0
info:
  title: Learn21.in API
  description: Learn21.in API docs
  version: 1.0.0
  contact:
    email: uplabs.in@gmail.com
    name: Learn21
paths:
  /course/{course_id}:
    get:
      description: Use this API to fetch details of a course
      parameters:
        - name: course_id
          required: true
          in: path
          schema:
            type: integer
      responses:
        "200":
          description: course created successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/course"
  /course:
    post:
      description: Use this API to create course
      requestBody:
        description: Structure of a course
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/course'
      responses:
        "200":
          description: course created successfully
        
components:
  schemas:
    course:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        id:
          type: integer