code: def make_auto_deployable(self, stage, swagger=None):
          
          if not swagger:
              return
  
          # CloudFormation does NOT redeploy the API unless it has a new deployment resource
          # that points to latest RestApi resource. Append a hash of Swagger Body location to
          # redeploy only when the API data changes. First 10 characters of hash is good enough
          # to prevent redeployment when API has not changed
  
          # NOTE: `str(swagger)` is for backwards compatibility. Changing it to a JSON or something will break compat
          generator = logical_id_generator.LogicalIdGenerator(self.logical_id, str(swagger))
          self.logical_id = generator.gen()
          hash = generator.get_hash(length=40)  # Get the full hash
          self.Description = "RestApi deployment id: {}".format(hash)
          stage.update_deployment_ref(self.logical_id)
docs: Sets up the resource such that it will triggers a re-deployment when Swagger changes
  
          :param swagger: Dictionary containing the Swagger definition of the API