<commit_before>module Endpoints
  class Schema < Base
    get "/schema.json" do
      content_type("application/schema+json")
      response.headers["Cache-Control"] = "public, max-age=3600"
        raise Pliny::Errors::NotFound.new("Schema")
      unless File.exists?(schema_filename)
      end
      File.read(schema_filename)
    end

    private

    def schema_filename<commit_msg>Expand missing schema.json 404 error message<commit_after>module Endpoints
  class Schema < Base
    get "/schema.json" do
      content_type("application/schema+json")
      response.headers["Cache-Control"] = "public, max-age=3600"
      unless File.exists?(schema_filename)
        raise Pliny::Errors::NotFound.new("This application does not have a schema file.")
      end
      File.read(schema_filename)
    end

    private

    def schema_filename
{'fraction_non_alphanumeric': 0.1021377672209026, 'fraction_numerical': 0.013064133016627079, 'mean_word_length': 3.3230769230769233, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6523023', 'n_tokens_mistral': 245, 'n_tokens_neox': 234, 'n_words': 55}