openapi: 3.0.3
info:
  title: Employee Directory API
  description: API to search Employee from an Employee Directory by different search parameters.
  version: 1.0.0
  contact:
    name: API Support
    email: support@example.com
servers:
  - url: /employees
    description: Base URL for Employee APIs
paths:
  /all:
    get:
      summary: Get All Employees
      description: Retrieve a list of all employees.
      operationId: getAllEmployees
      responses:
        '200':
          description: A list of employees.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Employee'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: string
  /{employeeId}:
    get:
      summary: Search Employee by ID
      description: Retrieve an employee by their unique ID.
      operationId: searchEmployeeById
      parameters:
        - name: employeeId
          in: path
          required: true
          description: The ID of the employee to retrieve.
          schema:
            type: integer
      responses:
        '200':
          description: The employee details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Employee'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: string
  /greaterThanAge/{age}:
    get:
      summary: Filter Employees by Age
      description: Retrieve all employees whose age is greater than the specified value.
      operationId: filterEmployeesByAge
      parameters:
        - name: age
          in: path
          required: true
          description: The age to filter employees by.
          schema:
            type: integer
      responses:
        '200':
          description: A list of employees.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Employee'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: string
  /fromCity/{cityName}:
    get:
      summary: Filter Employees by City
      description: Retrieve all employees from the specified city.
      operationId: filterEmployeesByCity
      parameters:
        - name: cityName
          in: path
          required: true
          description: The name of the city to filter employees by.
          schema:
            type: string
      responses:
        '200':
          description: A list of employees.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Employee'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: string
  /filterByAgeAndCity:
    get:
      summary: Filter Employees by Age and City
      description: Retrieve all employees from the specified city whose age is greater than the specified value.
      operationId: filterEmployeesByAgeAndCity
      parameters:
        - name: schoolId
          in: header
          required: true
          description: The school ID for filtering.
          schema:
            type: string
        - name: age
          in: query
          required: true
          description: The age to filter employees by.
          schema:
            type: integer
        - name: cityName
          in: query
          required: true
          description: The name of the city to filter employees by.
          schema:
            type: string
      responses:
        '200':
          description: A list of employees.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Employee'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: string
components:
  schemas:
    Employee:
      type: object
      properties:
        id:
          type: integer
          description: The unique ID of the employee.
        name:
          type: string
          description: The name of the employee.
        age:
          type: integer
          description: The age of the employee.
        city:
          type: string
          description: The city where the employee resides.
