Generate full-depth JSON Schemas for FML features

Open
#17,833 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
json, python, yaml

Research direction

Start by reading the code that generates and stores feature schemas from experimenter.yaml and the per-channel .fml.yaml files, then trace the branch editor autocomplete, schema display, and features page diffs that consume them. The issue names no specific code files or tests, so first locate those entry points and their existing schema tests. Done means generated schemas represent nested objects, enums, maps, lists, and optional fields, with desktop remaining out of scope.

Written by the indexing model from the issue text.

Description

Experimenter generates a JSON Schema for each mobile/web (FML) feature from experimenter.yaml, which nimbus-fml generate-experimenter produces. That projection flattens every nested FML type (objects, maps, lists) to json, drops Option nullability, and only keeps enum variants on top-level variables. The schema we store, display, and use for editor autocomplete therefore only describes top-level variables. For a feature like messaging, where most of the structure lives in nested objects (MessageData, StyleData, etc.), the schema shows almost nothing useful.

Deep validation of mobile feature values already goes through FmlClient against the full FML, so this is about the schema we generate and expose, not about validation correctness.

Proposal: generate the JSON Schema for FML features from the full FML (the per-channel .fml.yaml files we already fetch) so it covers the whole spec: nested objects, enums, maps, lists, and optional fields. Desktop is out of scope.

This touches several places that consume the stored schema today, including the branch editor's autocomplete (which only handles flat schemas), the schema display in the branch editor, and the feature schema diffs on the features page.

Related: #17675

┆Issue is synchronized with this Jira Task

Dominant language
Python
Stars
152
Forks
231
Avg merge
23h 54m
Merged PRs (30d)
201

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mozilla/experimenter

All issues in mozilla/experimenter

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.