Skip to content

[Request] Add version identifier to API results #143

@ddankel

Description

@ddankel

Adding a unique version identifier to the api results (either the root, every index page, or even every result) that incremented whenever data was updated would allow developers to quickly determine if their data is stale. One request to the api root could be used to see if anything changed instead of having to walk through every page and resource to update any cached data.

Example:

// https://api.genshin.dev/
{
  "types": [
    "artifacts",
    "boss",
    "characters",
    "consumables",
    "domains",
    "elements",
    "enemies",
    "materials",
    "nations",
    "weapons"
  ],
  "version": 123.4
}

Alternatively, instead of inserting version to some/all endpoints via middleware, a /version endpoint could be added for this purpose.

The example above uses a version number but it could also be a hash, uuid, datetime, or any other unique value. Something that could be calculated instead of having to be manually updated each release seems preferable. Perhaps use something like node-cache to cache a hash of the assets directory?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions