Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clarification + Move Index to an array
  • Loading branch information
dstufft committed Jun 17, 2022
commit bbc85839661e1c42c284f300ce1f91b7b1ce86b0
44 changes: 35 additions & 9 deletions pep-0691.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ There are two major issues with an HTML-based API:
fully support HTML5.

- HTML5 is primarily designed as a markup language to present documents for human
consumption. Our use of it is driven largely for historical reasons and accidental
consumption. Our use of it is driven largely for historical and accidental
reasons, and it's unlikely anyone would design an API that relied on it if
they were starting from scratch.

Expand Down Expand Up @@ -178,24 +178,41 @@ Project List
~~~~~~~~~~~~

The root URL ``/`` for this PEP (which represents the base URL) will be a JSON encoded
dictionary which has a single key, ``projects``, which is itself a dictionary where each
key is a string of the normalized project name, and the value is a dictionary with a
single key, ``url``, which represents the URL that the project can be fetched from. As
an example:
dictionary which has a single key, ``projects``, which is an array where each entry
is a dictionary with a single key, ``name``, which represents string of the project
name. As an example:

.. code-block:: json

{
"meta": {
"api-version": "1.0"
},
"projects": {
"frob": {"url": "/frob/"},
"spamspamspam": {"url": "/spamspamspam/"}
}
"projects": [
{"name": "Frob"},
{"name": "spamspamspam"},
]
}


.. note::

The ``name`` field is the same as the one from :pep:`503`, which does not specify
whether it is the non-normalized display name or the normalized name. In practice
different implementations of these PEPs are choosing differently here, so relying
on it being either non-normalized or normalized is relying on an implementation
detail of the repository in question.


.. note::

While the ``projects`` key is an array, and thus is required to be in some kind
of an order, neither :pep:`503` nor this PEP requires any specific ordering nor
that the ordering is consistent from one request to the next. Mentally this is
best thought of as a set, but both JSON and HTML lack the functionality to have
sets.


Project Detail
~~~~~~~~~~~~~~

Expand Down Expand Up @@ -286,6 +303,15 @@ As an example:
}


.. note::

While the ``files`` key is an array, and thus is required to be in some kind
of an order, neither :pep:`503` nor this PEP requires any specific ordering nor
that the ordering is consistent from one request to the next. Mentally this is
best thought of as a set, but both JSON and HTML lack the functionality to have
sets.


Content-Types
-------------

Expand Down