You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: json_parser.rb
    path of file: ./repos/vets-api/lib/common/client/middleware/response
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Common
  module Client
    module Middleware
      module Response
        class JsonParser < Faraday::Middleware
          WHITESPACE_REGEX =
    
          def on_complete(env)
            if env.response_headers['content-type']&.match?(/\bjson/)
              if env.body =~ WHITESPACE_REGEX || env.body =~ MHV_SUCCESS_REGEX
                env.body = ''
              else
                env.body = parse(env.body) unless UNPARSABLE_STATUS_CODES.include?(env[:status])
              end