Skip to content

wikimedia/schemas-event-secondary

Repository files navigation

'Secondary' event JSONSchemas for Wikimedia & MediaWiki event data

This schema repository contains schemas for events that do not directly affect user-facing features. These schemas represent "Tier 2" events. This repository complements the schemas/event/primary repository.

NOTE: The reason for having separate event schema repositories is to allow for different repository merge rights. Changes to primary schemas are subject to more restrictions than secondary schemas.

Browse

Schemas can be retrieved via the Web API at schema.wikimedia.org, for example:

curl https://schema.wikimedia.org/repositories/secondary/jsonschema/fragment/analytics/common/latest.json

Contributing

Most files in this repo are automatically generated by jsonschema-tools and must not be changed after their initial creation.

Follow the Event Platform Schema Guidelines when creating or updating schemas.

Prerequisites:

  • A clone of this Git repository.
  • Run npm install.

To update a schema:

  1. Edit the current.yaml file, and remember to increment the version in the $id field. ALWAYS increment the version after making changes to current.yaml.
  2. Run npm run build-modified, which generates the versioned YAML and JSON files.
  3. Commit the new and changed files to Git, and submit them for code review.

To create a schema:

  1. Create a subdirectory for the schema under one of the jsonschema/ namespace directories, and draft the first version in a new current.yaml file.
  2. Run npm run build-new path/to/your/current.yaml, which generates the versioned YAML and JSON files.
  3. Commit the new files to Git, and submit them for code review.

Namespaces:

  • analytics: Schemas that are used for analytics and "instrumentation" purposes should go in the jsonschema/analytics/ directory.

  • analytics/legacy: This directory is for legacy EventLogging schemas that have been migrated from meta.wikimedia.org's Schema namespace. After the associated instrument(s) are updated to use the migrated schema, all updates to the schema must be made in this repository, not on the legacy Schema page on Meta-Wiki.

    NOTE: Schemas in analytics/legacy are excluded from schema robustness tests.

See also