diff --git a/README.md b/README.md index 6c7b58098..7d1ef0a01 100644 --- a/README.md +++ b/README.md @@ -4,154 +4,6 @@ [![test](https://github.com/ruby-grape/grape/actions/workflows/test.yml/badge.svg)](https://github.com/ruby-grape/grape/actions/workflows/test.yml) [![Coverage Status](https://coveralls.io/repos/github/ruby-grape/grape/badge.svg?branch=master)](https://coveralls.io/github/ruby-grape/grape?branch=master) -## Table of Contents - -- [What is Grape?](#what-is-grape) -- [Stable Release](#stable-release) -- [Project Resources](#project-resources) -- [Grape for Enterprise](#grape-for-enterprise) -- [Installation](#installation) -- [Basic Usage](#basic-usage) -- [Rails 7.1](#rails-71) -- [Mounting](#mounting) - - [All](#all) - - [Rack](#rack) - - [Alongside Sinatra (or other frameworks)](#alongside-sinatra-or-other-frameworks) - - [Rails](#rails) - - [Zeitwerk](#zeitwerk) - - [Modules](#modules) -- [Remounting](#remounting) - - [Mount Configuration](#mount-configuration) -- [Versioning](#versioning) - - [Strategies](#strategies) - - [Path](#path) - - [Header](#header) - - [Accept-Version Header](#accept-version-header) - - [Param](#param) -- [Linting](#linting) - - [Bug in Rack::ETag under Rack 3.X](#bug-in-racketag-under-rack-3x) -- [Describing Methods](#describing-methods) -- [Configuration](#configuration) -- [Parameters](#parameters) - - [Params Class](#params-class) - - [Declared](#declared) - - [Include Parent Namespaces](#include-parent-namespaces) - - [Include Missing](#include-missing) - - [Evaluate Given](#evaluate-given) - - [Parameter Precedence](#parameter-precedence) -- [Parameter Validation and Coercion](#parameter-validation-and-coercion) - - [Supported Parameter Types](#supported-parameter-types) - - [Integer/Fixnum and Coercions](#integerfixnum-and-coercions) - - [Custom Types and Coercions](#custom-types-and-coercions) - - [Multipart File Parameters](#multipart-file-parameters) - - [First-Class JSON Types](#first-class-json-types) - - [Multiple Allowed Types](#multiple-allowed-types) - - [Validation of Nested Parameters](#validation-of-nested-parameters) - - [Dependent Parameters](#dependent-parameters) - - [Group Options](#group-options) - - [Renaming](#renaming) - - [Built-in Validators](#built-in-validators) - - [allow_blank](#allow_blank) - - [values](#values) - - [except_values](#except_values) - - [same_as](#same_as) - - [length](#length) - - [regexp](#regexp) - - [mutually_exclusive](#mutually_exclusive) - - [exactly_one_of](#exactly_one_of) - - [at_least_one_of](#at_least_one_of) - - [all_or_none_of](#all_or_none_of) - - [Nested mutually_exclusive, exactly_one_of, at_least_one_of, all_or_none_of](#nested-mutually_exclusive-exactly_one_of-at_least_one_of-all_or_none_of) - - [Namespace Validation and Coercion](#namespace-validation-and-coercion) - - [Custom Validators](#custom-validators) - - [Validation Errors](#validation-errors) - - [I18n](#i18n) - - [Custom Validation messages](#custom-validation-messages) - - [presence, allow_blank, values, regexp](#presence-allow_blank-values-regexp) - - [same_as](#same_as-1) - - [length](#length-1) - - [all_or_none_of](#all_or_none_of-1) - - [mutually_exclusive](#mutually_exclusive-1) - - [exactly_one_of](#exactly_one_of-1) - - [at_least_one_of](#at_least_one_of-1) - - [Coerce](#coerce) - - [With Lambdas](#with-lambdas) - - [Pass symbols for i18n translations](#pass-symbols-for-i18n-translations) - - [Overriding Attribute Names](#overriding-attribute-names) - - [With Default](#with-default) - - [Using dry-validation or dry-schema](#using-dry-validation-or-dry-schema) -- [Headers](#headers) - - [Request](#request) - - [Header Case Handling](#header-case-handling) - - [Response](#response) -- [Routes](#routes) -- [Helpers](#helpers) -- [Path Helpers](#path-helpers) -- [Parameter Documentation](#parameter-documentation) -- [Cookies](#cookies) -- [HTTP Status Code](#http-status-code) -- [Redirecting](#redirecting) -- [Recognizing Path](#recognizing-path) -- [Allowed Methods](#allowed-methods) -- [Raising Exceptions](#raising-exceptions) - - [Default Error HTTP Status Code](#default-error-http-status-code) - - [Handling 404](#handling-404) -- [Exception Handling](#exception-handling) - - [Rescuing exceptions inside namespaces](#rescuing-exceptions-inside-namespaces) - - [Unrescuable Exceptions](#unrescuable-exceptions) - - [Exceptions that should be rescued explicitly](#exceptions-that-should-be-rescued-explicitly) -- [Logging](#logging) -- [API Formats](#api-formats) - - [JSONP](#jsonp) - - [CORS](#cors) -- [Content-type](#content-type) -- [API Data Formats](#api-data-formats) -- [JSON and XML Processors](#json-and-xml-processors) -- [RESTful Model Representations](#restful-model-representations) - - [Grape Entities](#grape-entities) - - [Hypermedia and Roar](#hypermedia-and-roar) - - [Rabl](#rabl) - - [Active Model Serializers](#active-model-serializers) -- [Sending Raw or No Data](#sending-raw-or-no-data) -- [Authentication](#authentication) - - [Basic Auth](#basic-auth) - - [Register custom middleware for authentication](#register-custom-middleware-for-authentication) -- [Describing and Inspecting an API](#describing-and-inspecting-an-api) -- [Current Route and Endpoint](#current-route-and-endpoint) -- [Before, After and Finally](#before-after-and-finally) -- [Anchoring](#anchoring) -- [Instance Variables](#instance-variables) -- [Using Custom Middleware](#using-custom-middleware) - - [Grape Middleware](#grape-middleware) - - [Rails Middleware](#rails-middleware) - - [Remote IP](#remote-ip) -- [Writing Tests](#writing-tests) - - [Writing Tests with Rack](#writing-tests-with-rack) - - [RSpec](#rspec) - - [Airborne](#airborne) - - [MiniTest](#minitest) - - [Writing Tests with Rails](#writing-tests-with-rails) - - [RSpec](#rspec-1) - - [MiniTest](#minitest-1) - - [Stubbing Helpers](#stubbing-helpers) -- [Reloading API Changes in Development](#reloading-api-changes-in-development) - - [Reloading in Rack Applications](#reloading-in-rack-applications) - - [Reloading in Rails Applications](#reloading-in-rails-applications) -- [Performance Monitoring](#performance-monitoring) - - [Active Support Instrumentation](#active-support-instrumentation) - - [Hook Points](#hook-points) - - [endpoint_run.grape](#endpoint_rungrape) - - [endpoint_render.grape](#endpoint_rendergrape) - - [endpoint_run_filters.grape](#endpoint_run_filtersgrape) - - [endpoint_run_validators.grape](#endpoint_run_validatorsgrape) - - [format_response.grape](#format_responsegrape) - - [Subscribe to Hooks](#subscribe-to-hooks) - - [Monitoring Products](#monitoring-products) -- [Contributing to Grape](#contributing-to-grape) -- [Security](#security) -- [License](#license) -- [Copyright](#copyright) - ## What is Grape? Grape is a REST-like API framework for Ruby. It's designed to run on Rack or complement existing web application frameworks such as Rails and Sinatra by providing a simple DSL to easily develop RESTful APIs. It has built-in support for common conventions, including multiple formats, subdomain/prefix restriction, content negotiation, versioning and much more.