Greetings!
@cooperlees @sumanah and I would like to propose a PEP that formalizes the existing JSON API.
The PEP introduces a JSON Schema and includes changes to the API URL structure
- The draft: peps/pep-9999.rst at warehouse_json_api · nchepanov/peps · GitHub
- JSON Schema: peps/json_api.schema.json at warehouse_json_api · nchepanov/peps · GitHub
Non-goals
The following is not part of this proposal, but is likely to warrant subsequent PEPs:
- Adding properties that aren’t already returned by the legacy JSON API endpoints
- Removing properties that are already returned by the legacy JSON API endpoints
- Adding discovery endpoints
- Adding pagination capabilities
- Adding authentication
- Adding writeable endpoints
- Supporting TUF (PEP 458): This version of the JSON API is not protected by TUF, and so should not be used for dependency resolution.
- Deprecating XMLRPC API: The PEP lays out the foundation for the future deprecation of the XMLRPC API.
Proposed API structure changes
$root/pypi/$project_name/json -> $root/api/v1/project/$project_name/latest
$root/pypi/$project_name/$version/json -> $root/api/v1/project/$project_name/$version
Help needed
-
Should
X-PyPI-Last-Serial
header be part of the spec? -
I’d appreciate if someone with better understanding of the domain can verify for all properties:
- is it nullable?
- is it required?
- is it deprecated?
Relevant background:
https://discuss.python.org/t/pep-for-the-python-package-index-json-api/5717
https://github.com/pypa/packaging-problems/issues/367
https://github.com/devpi/devpi/issues/801