specifications icon indicating copy to clipboard operation
specifications copied to clipboard

JSON package meta-data is not specified

Open htgoebel opened this issue 5 years ago • 1 comments

The JSON data (application/vnd.hex+json) delivered by

  • https://hex.pm/api/packages/NAME
  • https://hex.pm/api/packages/NAME/releases/VERSION

is not documented.

While most of the fields delivered can be guessed, some are not obvious. Some examples:

  • (package url vs. html_url vs doc_html_url
  • (package) meta -> elixir
  • (release) meta -> app
  • (release) meta -> elixir (also: what does null mean here)
  • (release) inserted_at vs.updated_at
  • (release) url vs. html_url (seems to be the same in many cases)

Beside a description of the fields, it would be nice to have a specification one can rely on.

(FYI: I'm building a importer from hex.pm packages into guix, for which I need to query this data.)

htgoebel avatar Jul 10 '20 19:07 htgoebel

See https://github.com/hexpm/specifications/blob/master/apiary.apib#L400 and https://github.com/hexpm/specifications/blob/master/apiary.apib#L471.

Some fields are not documented for every resource because they are following conventions or assume some knowledge about elixir and hex.

You can find information about the package metadata here: https://github.com/hexpm/specifications/blob/master/package_metadata.md.

  • url is the URL to the currently described resource.
  • html_url is the URL to the hex.pm website of the current resource.
  • doc_html_url is the URL to the website page for the package documentation.
  • inserted_at when the resource was created
  • updated_at when the resource was last updated

If you feel anything is missing in the HTTP API docs please send pull requests that fill in the missing information as you learn more. Thank you.

ericmj avatar Jul 10 '20 19:07 ericmj