---
openapi: 3.0.0
info:
  title: Portal Example Orders
  description: This is a generic API definition for manipulation of order resources. It contains basic CRUD operations for order resources.
  version: 1.0
paths:
  /order:
    get:
      summary: Retrieve order resources.
      description: Retrieve a bunch of order resources. Specify example resource as body payload.
      operationId: getorderList
      responses:
        200:
          description: Get an array of order resources.
    post:
      summary: Create new order resource.
      description: Create a new order resource. Specify payload within request body.
      operationId: createorder
      requestBody:
        description: The payload of resource order to create.
        content:
          application/json:
            schema:
              $ref: '#/components/schema/orderType'
      responses:
        201:
          description: Get the newly created order resource.
  /order/{id}:
    get:
      summary: Retrieve a order resource.
      description: Retrieve an already existing order resource having the specified id.
      operationId: getorderById
      responses:
        200:
          description: order resource having specified id.
          content:
            application/json:
              schema:
                $ref: '#/components/schema/orderType'
    put:
      summary: Update a order resource.
      description: Update an already existing order resource having the specified id.
      operationId: updateorderById
      requestBody:
        description: The payload of resource order to update.
        content:
          application/json:
            schema:
              $ref: '#/components/schema/orderType'
      responses:
        200:
          description: Updated order resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schema/orderType'
    delete:
      summary: Delete a order resource.
      description: Remove an existing order resource having the specified id.
      operationId: deleteorderById
      responses:
        204:
          description: Resource order with specified id has been removed.
    parameters:
      - name: id
        in: path
        description: Id of resource
        required: true
        schema:
          type: string
components:
  schemas:
    orderType:
      type: object
      properties:
        orderId:
          type: string
        orderDetails:
          type: object
          properties:
            product:
              type: string
        id:
          type: string
