changeset 2493:407147d8020f

Documented 413 error for PATCH and POST methods in the API.
author Yaroslav Zhuravlev <yar@nginx.com>
date Thu, 19 Dec 2019 16:29:20 +0300
parents 70119804679c
children 78d4e25adf49
files xml/en/docs/http/ngx_http_api_module.xml xml/en/docs/http/ngx_http_api_module_head.xml yaml/nginx_api.yaml
diffstat 3 files changed, 40 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_api_module.xml
+++ b/xml/en/docs/http/ngx_http_api_module.xml
@@ -9,7 +9,7 @@
 <module name="Module ngx_http_api_module"
         link="/en/docs/http/ngx_http_api_module.html"
         lang="en"
-        rev="2">
+        rev="3">
 
 <section id="summary">
 
@@ -31,6 +31,15 @@ modules.
 </para>
 
 <para>
+When using the <literal>PATCH</literal> or <literal>POST</literal> methods,
+make sure that the payload does not exceed the
+<link doc="ngx_http_core_module.xml" id="client_body_buffer_size">buffer size</link>
+for reading the client request body, otherwise, the
+<http-status code="413" text="Request Entity Too Large"/>
+error may be returned.
+</para>
+
+<para>
 <note>
 This module is available as part of our
 <commercial_version>commercial subscription</commercial_version>.
@@ -1189,6 +1198,7 @@ only one key can be added (<literal>Keyv
 <listitem>404 - Keyval not found (<literal>KeyvalNotFound</literal>), returns <link id="def_nginx_error">Error</link></listitem>
 <listitem>405 - Method disabled (<literal>MethodDisabled</literal>), returns <link id="def_nginx_error">Error</link></listitem>
 <listitem>409 - Key already exists (<literal>KeyvalKeyExists</literal>), returns <link id="def_nginx_error">Error</link></listitem>
+<listitem>413 - Request Entity Too Large, returns <link id="def_nginx_error">Error</link></listitem>
 <listitem>415 - JSON error (<literal>JsonError</literal>), returns <link id="def_nginx_error">Error</link></listitem>
 </list>
 </listitem>
@@ -1216,6 +1226,7 @@ only one key can be updated (<literal>Ke
 <listitem>404 - Keyval not found (<literal>KeyvalNotFound</literal>),
 keyval key not found (<literal>KeyvalKeyNotFound</literal>), returns <link id="def_nginx_error">Error</link></listitem>
 <listitem>405 - Method disabled (<literal>MethodDisabled</literal>), returns <link id="def_nginx_error">Error</link></listitem>
+<listitem>413 - Request Entity Too Large, returns <link id="def_nginx_error">Error</link></listitem>
 <listitem>415 - JSON error (<literal>JsonError</literal>), returns <link id="def_nginx_error">Error</link></listitem>
 </list>
 </listitem>
@@ -1717,6 +1728,7 @@ only one key can be added (<literal>Keyv
 <listitem>404 - Keyval not found (<literal>KeyvalNotFound</literal>), returns <link id="def_nginx_error">Error</link></listitem>
 <listitem>405 - Method disabled (<literal>MethodDisabled</literal>), returns <link id="def_nginx_error">Error</link></listitem>
 <listitem>409 - Key already exists (<literal>KeyvalKeyExists</literal>), returns <link id="def_nginx_error">Error</link></listitem>
+<listitem>413 - Request Entity Too Large, returns <link id="def_nginx_error">Error</link></listitem>
 <listitem>415 - JSON error (<literal>JsonError</literal>), returns <link id="def_nginx_error">Error</link></listitem>
 </list>
 </listitem>
@@ -1744,6 +1756,7 @@ only one key can be updated (<literal>Ke
 <listitem>404 - Keyval not found (<literal>KeyvalNotFound</literal>),
 keyval key not found (<literal>KeyvalKeyNotFound</literal>), returns <link id="def_nginx_error">Error</link></listitem>
 <listitem>405 - Method disabled (<literal>MethodDisabled</literal>), returns <link id="def_nginx_error">Error</link></listitem>
+<listitem>413 - Request Entity Too Large, returns <link id="def_nginx_error">Error</link></listitem>
 <listitem>415 - JSON error (<literal>JsonError</literal>), returns <link id="def_nginx_error">Error</link></listitem>
 </list>
 </listitem>
--- a/xml/en/docs/http/ngx_http_api_module_head.xml
+++ b/xml/en/docs/http/ngx_http_api_module_head.xml
@@ -9,7 +9,7 @@
 <module name="Module ngx_http_api_module"
         link="/en/docs/http/ngx_http_api_module.html"
         lang="en"
-        rev="2">
+        rev="3">
 
 <section id="summary">
 
@@ -31,6 +31,15 @@ modules.
 </para>
 
 <para>
+When using the <literal>PATCH</literal> or <literal>POST</literal> methods,
+make sure that the payload does not exceed the
+<link doc="ngx_http_core_module.xml" id="client_body_buffer_size">buffer size</link>
+for reading the client request body, otherwise, the
+<http-status code="413" text="Request Entity Too Large"/>
+error may be returned.
+</para>
+
+<para>
 <note>
 This module is available as part of our
 <commercial_version>commercial subscription</commercial_version>.
--- a/yaml/nginx_api.yaml
+++ b/yaml/nginx_api.yaml
@@ -1031,6 +1031,10 @@ paths:
           description: Key already exists (*KeyvalKeyExists*)
           schema:
             $ref: '#/definitions/NginxError'
+        '413':
+          description: Request Entity Too Large
+          schema:
+            $ref: '#/definitions/NginxError'
         '415':
           description: JSON error (*JsonError*)
           schema:
@@ -1084,6 +1088,10 @@ paths:
           description: Method disabled (*MethodDisabled*)
           schema:
             $ref: '#/definitions/NginxError'
+        '413':
+          description: Request Entity Too Large
+          schema:
+            $ref: '#/definitions/NginxError'
         '415':
           description: JSON error (*JsonError*)
           schema:
@@ -1687,6 +1695,10 @@ paths:
           description: Key already exists (*KeyvalKeyExists*)
           schema:
             $ref: '#/definitions/NginxError'
+        '413':
+          description: Request Entity Too Large
+          schema:
+            $ref: '#/definitions/NginxError'
         '415':
           description: JSON error (*JsonError*)
           schema:
@@ -1740,6 +1752,10 @@ paths:
           description: Method disabled (*MethodDisabled*)
           schema:
             $ref: '#/definitions/NginxError'
+        '413':
+          description: Request Entity Too Large
+          schema:
+            $ref: '#/definitions/NginxError'
         '415':
           description: JSON error (*JsonError*)
           schema: