<commit_before>class JobsController < ApplicationController

  def index
    render json: Job.last
  end

  api :POST, "/jobs", "Send a job invitation"
  #error :code => 401, :desc => "Unauthorized"
  #error :code => 404, :desc => "Not Found", :meta => {:anything => "you can think of"}
  param :title, String, desc: "Title of the proposed job"
  param :email, String, desc: "Email of the person(s) to contact for more info"
  description "Stop sending old fashioned emails. Start using the new API reality."
  formats ['json']
  example " 'title':'<NAME>' "
  def create
    job = Job.new(job_params)

    if job.save
      render json: { status: :submitted }
    else
      render json: { status: :failure, message: "Invalid parameters" }
    end
  end

  private

  def job_params
    params.slice(:title, :email).permit(:title, :email)
  end

  #curl -X POST -H "Content-Type: application/json" -d '{"title":"Developer","email":"<EMAIL>"}' http://localhost:3000/jobs
end
<commit_msg>some parameters are required<commit_after>class JobsController < ApplicationController

  def index
    render json: Job.last
  end

  api :POST, "/jobs", "Send a job invitation"
  #error :code => 401, :desc => "Unauthorized"
  #error :code => 404, :desc => "Not Found", :meta => {:anything => "you can think of"}
  param :title, String, desc: "Title of the proposed job", required: true
  param :email, String, desc: "Email of the person(s) to contact for more info", required: true
  description "Stop sending old fashioned emails. Start using the new API reality."
  formats ['json']
  example " 'title':'<NAME>' "
  def create
    job = Job.new(job_params)

    if job.save
      render json: { status: :submitted }
    else
      render json: { status: :failure, message: "Invalid parameters" }
    end
  end

  private

  def job_params
    params.slice(:title, :email).permit(:title, :email)
  end

  #curl -X POST -H "Content-Type: application/json" -d '{"title":"Developer","email":"<EMAIL>"}' http://localhost:3000/jobs
end

{'fraction_non_alphanumeric': 0.13854527461652646, 'fraction_numerical': 0.009896091044037604, 'mean_word_length': 3.6805555555555554, 'pattern_counts': {'":': 4, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5430190', 'n_tokens_mistral': 658, 'n_tokens_neox': 609, 'n_words': 223}