|
4 | 4 | [](https://github.com/ruby-grape/grape/actions/workflows/test.yml) |
5 | 5 | [](https://coveralls.io/github/ruby-grape/grape?branch=master) |
6 | 6 |
|
7 | | -## Table of Contents |
8 | | - |
9 | | -- [What is Grape?](#what-is-grape) |
10 | | -- [Stable Release](#stable-release) |
11 | | -- [Project Resources](#project-resources) |
12 | | -- [Grape for Enterprise](#grape-for-enterprise) |
13 | | -- [Installation](#installation) |
14 | | -- [Basic Usage](#basic-usage) |
15 | | -- [Rails 7.1](#rails-71) |
16 | | -- [Mounting](#mounting) |
17 | | - - [All](#all) |
18 | | - - [Rack](#rack) |
19 | | - - [Alongside Sinatra (or other frameworks)](#alongside-sinatra-or-other-frameworks) |
20 | | - - [Rails](#rails) |
21 | | - - [Zeitwerk](#zeitwerk) |
22 | | - - [Modules](#modules) |
23 | | -- [Remounting](#remounting) |
24 | | - - [Mount Configuration](#mount-configuration) |
25 | | -- [Versioning](#versioning) |
26 | | - - [Strategies](#strategies) |
27 | | - - [Path](#path) |
28 | | - - [Header](#header) |
29 | | - - [Accept-Version Header](#accept-version-header) |
30 | | - - [Param](#param) |
31 | | -- [Linting](#linting) |
32 | | - - [Bug in Rack::ETag under Rack 3.X](#bug-in-racketag-under-rack-3x) |
33 | | -- [Describing Methods](#describing-methods) |
34 | | -- [Configuration](#configuration) |
35 | | -- [Parameters](#parameters) |
36 | | - - [Params Class](#params-class) |
37 | | - - [Declared](#declared) |
38 | | - - [Include Parent Namespaces](#include-parent-namespaces) |
39 | | - - [Include Missing](#include-missing) |
40 | | - - [Evaluate Given](#evaluate-given) |
41 | | - - [Parameter Precedence](#parameter-precedence) |
42 | | -- [Parameter Validation and Coercion](#parameter-validation-and-coercion) |
43 | | - - [Supported Parameter Types](#supported-parameter-types) |
44 | | - - [Integer/Fixnum and Coercions](#integerfixnum-and-coercions) |
45 | | - - [Custom Types and Coercions](#custom-types-and-coercions) |
46 | | - - [Multipart File Parameters](#multipart-file-parameters) |
47 | | - - [First-Class JSON Types](#first-class-json-types) |
48 | | - - [Multiple Allowed Types](#multiple-allowed-types) |
49 | | - - [Validation of Nested Parameters](#validation-of-nested-parameters) |
50 | | - - [Dependent Parameters](#dependent-parameters) |
51 | | - - [Group Options](#group-options) |
52 | | - - [Renaming](#renaming) |
53 | | - - [Built-in Validators](#built-in-validators) |
54 | | - - [allow_blank](#allow_blank) |
55 | | - - [values](#values) |
56 | | - - [except_values](#except_values) |
57 | | - - [same_as](#same_as) |
58 | | - - [length](#length) |
59 | | - - [regexp](#regexp) |
60 | | - - [mutually_exclusive](#mutually_exclusive) |
61 | | - - [exactly_one_of](#exactly_one_of) |
62 | | - - [at_least_one_of](#at_least_one_of) |
63 | | - - [all_or_none_of](#all_or_none_of) |
64 | | - - [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) |
65 | | - - [Namespace Validation and Coercion](#namespace-validation-and-coercion) |
66 | | - - [Custom Validators](#custom-validators) |
67 | | - - [Validation Errors](#validation-errors) |
68 | | - - [I18n](#i18n) |
69 | | - - [Custom Validation messages](#custom-validation-messages) |
70 | | - - [presence, allow_blank, values, regexp](#presence-allow_blank-values-regexp) |
71 | | - - [same_as](#same_as-1) |
72 | | - - [length](#length-1) |
73 | | - - [all_or_none_of](#all_or_none_of-1) |
74 | | - - [mutually_exclusive](#mutually_exclusive-1) |
75 | | - - [exactly_one_of](#exactly_one_of-1) |
76 | | - - [at_least_one_of](#at_least_one_of-1) |
77 | | - - [Coerce](#coerce) |
78 | | - - [With Lambdas](#with-lambdas) |
79 | | - - [Pass symbols for i18n translations](#pass-symbols-for-i18n-translations) |
80 | | - - [Overriding Attribute Names](#overriding-attribute-names) |
81 | | - - [With Default](#with-default) |
82 | | - - [Using dry-validation or dry-schema](#using-dry-validation-or-dry-schema) |
83 | | -- [Headers](#headers) |
84 | | - - [Request](#request) |
85 | | - - [Header Case Handling](#header-case-handling) |
86 | | - - [Response](#response) |
87 | | -- [Routes](#routes) |
88 | | -- [Helpers](#helpers) |
89 | | -- [Path Helpers](#path-helpers) |
90 | | -- [Parameter Documentation](#parameter-documentation) |
91 | | -- [Cookies](#cookies) |
92 | | -- [HTTP Status Code](#http-status-code) |
93 | | -- [Redirecting](#redirecting) |
94 | | -- [Recognizing Path](#recognizing-path) |
95 | | -- [Allowed Methods](#allowed-methods) |
96 | | -- [Raising Exceptions](#raising-exceptions) |
97 | | - - [Default Error HTTP Status Code](#default-error-http-status-code) |
98 | | - - [Handling 404](#handling-404) |
99 | | -- [Exception Handling](#exception-handling) |
100 | | - - [Rescuing exceptions inside namespaces](#rescuing-exceptions-inside-namespaces) |
101 | | - - [Unrescuable Exceptions](#unrescuable-exceptions) |
102 | | - - [Exceptions that should be rescued explicitly](#exceptions-that-should-be-rescued-explicitly) |
103 | | -- [Logging](#logging) |
104 | | -- [API Formats](#api-formats) |
105 | | - - [JSONP](#jsonp) |
106 | | - - [CORS](#cors) |
107 | | -- [Content-type](#content-type) |
108 | | -- [API Data Formats](#api-data-formats) |
109 | | -- [JSON and XML Processors](#json-and-xml-processors) |
110 | | -- [RESTful Model Representations](#restful-model-representations) |
111 | | - - [Grape Entities](#grape-entities) |
112 | | - - [Hypermedia and Roar](#hypermedia-and-roar) |
113 | | - - [Rabl](#rabl) |
114 | | - - [Active Model Serializers](#active-model-serializers) |
115 | | -- [Sending Raw or No Data](#sending-raw-or-no-data) |
116 | | -- [Authentication](#authentication) |
117 | | - - [Basic Auth](#basic-auth) |
118 | | - - [Register custom middleware for authentication](#register-custom-middleware-for-authentication) |
119 | | -- [Describing and Inspecting an API](#describing-and-inspecting-an-api) |
120 | | -- [Current Route and Endpoint](#current-route-and-endpoint) |
121 | | -- [Before, After and Finally](#before-after-and-finally) |
122 | | -- [Anchoring](#anchoring) |
123 | | -- [Instance Variables](#instance-variables) |
124 | | -- [Using Custom Middleware](#using-custom-middleware) |
125 | | - - [Grape Middleware](#grape-middleware) |
126 | | - - [Rails Middleware](#rails-middleware) |
127 | | - - [Remote IP](#remote-ip) |
128 | | -- [Writing Tests](#writing-tests) |
129 | | - - [Writing Tests with Rack](#writing-tests-with-rack) |
130 | | - - [RSpec](#rspec) |
131 | | - - [Airborne](#airborne) |
132 | | - - [MiniTest](#minitest) |
133 | | - - [Writing Tests with Rails](#writing-tests-with-rails) |
134 | | - - [RSpec](#rspec-1) |
135 | | - - [MiniTest](#minitest-1) |
136 | | - - [Stubbing Helpers](#stubbing-helpers) |
137 | | -- [Reloading API Changes in Development](#reloading-api-changes-in-development) |
138 | | - - [Reloading in Rack Applications](#reloading-in-rack-applications) |
139 | | - - [Reloading in Rails Applications](#reloading-in-rails-applications) |
140 | | -- [Performance Monitoring](#performance-monitoring) |
141 | | - - [Active Support Instrumentation](#active-support-instrumentation) |
142 | | - - [Hook Points](#hook-points) |
143 | | - - [endpoint_run.grape](#endpoint_rungrape) |
144 | | - - [endpoint_render.grape](#endpoint_rendergrape) |
145 | | - - [endpoint_run_filters.grape](#endpoint_run_filtersgrape) |
146 | | - - [endpoint_run_validators.grape](#endpoint_run_validatorsgrape) |
147 | | - - [format_response.grape](#format_responsegrape) |
148 | | - - [Subscribe to Hooks](#subscribe-to-hooks) |
149 | | - - [Monitoring Products](#monitoring-products) |
150 | | -- [Contributing to Grape](#contributing-to-grape) |
151 | | -- [Security](#security) |
152 | | -- [License](#license) |
153 | | -- [Copyright](#copyright) |
154 | | - |
155 | 7 | ## What is Grape? |
156 | 8 |
|
157 | 9 | 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. |
|
0 commit comments