Skip to content

Commit c1a59f1

Browse files
committed
Merge branch 'feature/11'
Close #11
2 parents 8d4e8e7 + 8ebdcc9 commit c1a59f1

23 files changed

+108
-110
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Api-Problem: ZF2 Module for API-Problem representations
33

44
This module provides data structures and rendering for the API-Problem format.
55

6-
- [Problem API](http://tools.ietf.org/html/draft-nottingham-http-problem-02),
6+
- [Problem API](http://tools.ietf.org/html/draft-nottingham-http-problem-05),
77
used for reporting API problems

docs/api/phpdoc/classes/PhlyRestfully.ApiProblem.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ <h3>
8787
<i class="icon-custom icon-method"></i> Methods</h3>
8888
<a id="method___construct"></a><div class="element clickable method public method___construct" data-toggle="collapse" data-target=".method___construct .collapse">
8989
<h2>Constructor</h2>
90-
<pre>__construct(int $httpStatus, string $detail, string $describedBy, string $title, array $additional) </pre>
90+
<pre>__construct(int $status, string $detail, string $describedBy, string $title, array $additional) </pre>
9191
<div class="labels"></div>
9292
<div class="row collapse"><div class="detail-description">
9393
<div class="long_description"><p>Create an instance using the provided information. If nothing is
9494
provided for the describedBy field, the class default will be used;
95-
if the httpStatus matches any known, the title field will be selected
95+
if the status matches any known, the title field will be selected
9696
from $problemStatusTitles as a result.</p></div>
9797
<h3>Parameters</h3>
9898
<div class="subelement argument">
99-
<h4>$httpStatus</h4>
99+
<h4>$status</h4>
100100
<code>int</code>
101101
</div>
102102
<div class="subelement argument">

docs/api/phpdoc/classes/PhlyRestfully.ResourceController.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
</tr>
127127
<tr>
128128
<th>see</th>
129-
<td><a href="">\PhlyRestfully\http://tools.ietf.org/html/draft-nottingham-http-problem-02</a></td>
129+
<td><a href="">\PhlyRestfully\http://tools.ietf.org/html/draft-nottingham-http-problem-05</a></td>
130130
</tr>
131131
</table>
132132
<h3>

docs/api/phpdoc/classes/PhlyRestfully.View.RestfulJsonStrategy.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888

8989
<ul>
9090
<li>application/hal+json for a result that contains HAL-compliant links</li>
91-
<li>application/api-problem+json for a result that contains a Problem
91+
<li>application/problem+json for a result that contains a Problem
9292
API-formatted response</li>
9393
<li>application/json for all other responses</li>
9494
</ul></div>

docs/api/phpdoc/structure.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@
306306
<description>Constructor</description>
307307
<long-description>&lt;p&gt;Create an instance using the provided information. If nothing is
308308
provided for the describedBy field, the class default will be used;
309-
if the httpStatus matches any known, the title field will be selected
309+
if the status matches any known, the title field will be selected
310310
from $problemStatusTitles as a result.&lt;/p&gt;</long-description>
311-
<tag line="118" name="param" description="" type="int" variable="$httpStatus">
311+
<tag line="118" name="param" description="" type="int" variable="$status">
312312
<type by_reference="false">int</type>
313313
</tag>
314314
<tag line="118" name="param" description="" type="string" variable="$detail">
@@ -322,7 +322,7 @@ from $problemStatusTitles as a result.&lt;/p&gt;</long-description>
322322
</tag>
323323
</docblock>
324324
<argument line="131">
325-
<name>$httpStatus</name>
325+
<name>$status</name>
326326
<default></default>
327327
<type/>
328328
</argument>
@@ -1944,7 +1944,7 @@ a Content-Type header appropriate to the response it describes.</description>
19441944

19451945
&lt;ul&gt;
19461946
&lt;li&gt;application/hal+json for a result that contains HAL-compliant links&lt;/li&gt;
1947-
&lt;li&gt;application/api-problem+json for a result that contains a Problem
1947+
&lt;li&gt;application/problem+json for a result that contains a Problem
19481948
API-formatted response&lt;/li&gt;
19491949
&lt;li&gt;application/json for all other responses&lt;/li&gt;
19501950
&lt;/ul&gt;</long-description>
@@ -2553,7 +2553,7 @@ to allow injecting the specific resource you wish to use (and its listeners),
25532553
which will also allow you to have multiple instances of the controller when
25542554
desired.&lt;/p&gt;</long-description>
25552555
<tag line="16" name="see" description="\PhlyRestfully\http://tools.ietf.org/html/draft-kelly-json-hal-03" refers="\PhlyRestfully\http://tools.ietf.org/html/draft-kelly-json-hal-03"/>
2556-
<tag line="16" name="see" description="\PhlyRestfully\http://tools.ietf.org/html/draft-nottingham-http-problem-02" refers="\PhlyRestfully\http://tools.ietf.org/html/draft-nottingham-http-problem-02"/>
2556+
<tag line="16" name="see" description="\PhlyRestfully\http://tools.ietf.org/html/draft-nottingham-http-problem-05" refers="\PhlyRestfully\http://tools.ietf.org/html/draft-nottingham-http-problem-05"/>
25572557
</docblock>
25582558
<method final="false" abstract="false" static="false" visibility="public" namespace="PhlyRestfully" line="129" package="Default">
25592559
<name>__construct</name>

docs/basics/resources.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ needs to define the following methods:
7676
- **getDescribedBy()**, which should return a URI for the "describedBy" field.
7777
- **getTitle()**, which should return a string for the "title" field.
7878

79-
The exception code and message will be used for the "httpStatus" and "detail",
79+
The exception code and message will be used for the "status" and "detail",
8080
respectively.
8181

8282
The ``CreationException``, ``UpdateException``, and ``PatchException`` types all

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ implementing RESTful JSON APIs in `Hypermedia Application Language (HAL)
99
<http://stateless.co/hal_specification.html>`_. It provides a workflow for
1010
mapping persistence to resources to expose via your API.
1111

12-
For error reporting, it uses `API-Problem <http://tools.ietf.org/html/draft-nottingham-http-problem-02>`_.
12+
For error reporting, it uses `API-Problem <http://tools.ietf.org/html/draft-nottingham-http-problem-05>`_.
1313

1414
Contents:
1515

1616
.. toctree::
1717
:hidden:
18-
18+
1919
halprimer
2020
problems
2121
options

docs/problems.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ returning ``Api-Problem`` payloads.
1717
API-Problem
1818
-----------
1919

20-
This mediatype, ``application/api-problem+json`` is `via the IETF
21-
<http://tools.ietf.org/html/draft-nottingham-http-problem-02>`_, and actually
20+
This mediatype, ``application/problem+json`` is `via the IETF
21+
<http://tools.ietf.org/html/draft-nottingham-http-problem-05>`_, and actually
2222
also includes an XML variant. The structure includes the following properties:
2323

2424
- **describedBy**: a URL to a document describing the error condition (required)
2525
- **title**: a brief title for the error condition (required)
26-
- **httpStatus**: the HTTP status code for the current request (optional)
26+
- **status**: the HTTP status code for the current request (optional)
2727
- **detail**: error details specific to this request (optional)
2828
- **supportId**: a URL to the specific problem occurrence (e.g., to a log message) (optional)
2929

@@ -32,12 +32,12 @@ As an example payload:
3232
.. code-block:: http
3333
3434
HTTP/1.1 500 Internal Error
35-
Content-Type: application/api-problem+json
36-
35+
Content-Type: application/problem+json
36+
3737
{
3838
"describedBy": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
3939
"detail": "Status failed validation",
40-
"httpStatus": 500,
40+
"status": 500,
4141
"title": "Internal Server Error"
4242
}
4343

docs/ref/alternate-resource-return-values.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ HalResource and HalCollection
2020
``PhlyRestfully\HalResource`` and ``PhlyRestfully\HalCollection`` are simply
2121
wrappers for the resources and collections you create, and provide the ability
2222
to aggregate referential links. Links are aggregated in a
23-
``PhlyRestfully\LinkCollection`` as individual ``PhlyRestfully\Link`` objects.
23+
``PhlyRestfully\LinkCollection`` as individual ``PhlyRestfully\Link`` objects.
2424

2525
``HalResource`` requires that you pass a resource and its identifier in the
2626
constructor, and then allows you to aggregate links:
@@ -71,8 +71,8 @@ addition of several relational links.
7171
.. code-block:: php
7272
:linenos:
7373
74-
use PhlyRestfully\HalCollection;
75-
use PhlyRestfully\Link;
74+
use PhlyRestfully\HalCollection;
75+
use PhlyRestfully\Link;
7676
7777
// Assume $users is an iterable set of users for seeding the collection.
7878
$collection = new HalCollection($users);
@@ -142,7 +142,7 @@ The signature of the constructor is:
142142
:linenos:
143143
144144
public function __construct(
145-
$httpStatus, // HTTP status code used for the response
145+
$status, // HTTP status code used for the response
146146
$detail, // Summary of what happened
147147
$describedBy = null, // URI to a description of the problem
148148
$title = null, // Generic title for the problem
@@ -156,7 +156,7 @@ listener, and it will be used directly.
156156
:linenos:
157157
158158
use PhlyRestfully\ApiProblem;
159-
159+
160160
return new ApiProblem(
161161
418,
162162
'Exceeded rate limit',

docs/ref/api-problem-listener.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ exception, setting it as the result.
4848

4949
This latter bit, the ``Accept`` header matching, is configurable. If you want to
5050
allow an API-Problem response for other than the default set of mediatypes
51-
(``application/hal+json``, ``application/api-problem+json``, and
51+
(``application/hal+json``, ``application/problem+json``, and
5252
``application/json``), you can do so via your configuration. Set the value in
5353
the ``accept_filters`` subkey of the ``zf-hal`` configuration; the value
5454
should be a comma-separated set of mimetypes.

0 commit comments

Comments
 (0)