Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 30, 2025

Schema audit identified 18 single-value enum declarations that should use const for more precise validation. Tasks 1-4 (metadata, applyTo description, examples) were already complete.

Changes

  • main_workflow_schema.json: 10 conversions

    • Event types: check_suite, merge_group, watch
    • Permission constraints: all, roles
    • Network/firewall defaults
    • MCP tool types
  • mcp_config_schema.json: 4 conversions

    • Type constraints in conditional schemas (http, stdio)
  • included_file_schema.json: 4 conversions

    • Safe-inputs mode, network defaults, MCP tool types

Example

Before:

{
  "type": "string",
  "enum": ["http"]
}

After:

{
  "type": "string",
  "const": "http"
}

Using const instead of single-value enums improves IDE autocomplete and makes validation errors more specific.

Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Improve schema metadata and documentation quality</issue_title>
<issue_description>## Overview

This tracking issue covers improvements to schema metadata and documentation quality identified in the December 29, 2025 schema audit.

Source: Discussion #8130

The audit identified 8 issues (2 critical, 6 moderate) across our three schema files. While internal consistency is excellent (100% root descriptions, all $defs used, strong validation), we need to improve metadata and example coverage for better IDE integration and developer experience.

Planned Tasks

This work is broken down into 5 focused sub-issues:

  1. Add top-level metadata to all schemas - Critical for IDE integration and schema identification
  2. Add applyTo field description - Complete missing root-level documentation
  3. Add examples to major workflow fields - Improve discoverability of key features
  4. Add examples to MCP schema - Currently has zero examples despite complexity
  5. Improve schema validation constraints - Convert single-value enums and add format constraints

Context

All identified issues have persisted since the November 2025 audit (no regression, but no improvement either). These improvements will:

  • Enhance IDE autocomplete and inline documentation
  • Support schema versioning and evolution tracking
  • Improve developer onboarding and discoverability
  • Strengthen validation with better constraints

Priority

AI generated by Plan Command for discussion #8130

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Replace 18 single-value enum declarations with const across all three schema files:
- main_workflow_schema.json: 10 enums -> const
- mcp_config_schema.json: 4 enums -> const
- included_file_schema.json: 4 enums -> const

This improves schema validation by using the more precise const keyword for
fields that only accept a single value, providing better IDE support and
validation feedback.

Examples:
- enum: ["completed"] -> const: "completed"
- enum: ["http"] -> const: "http"
- enum: ["all"] -> const: "all"

Co-authored-by: mnkiefer <[email protected]>
Copilot AI changed the title [WIP] Improve schema metadata and documentation quality Convert single-value enums to const in JSON schemas Dec 30, 2025
Copilot AI requested a review from mnkiefer December 30, 2025 05:13
@pelikhan pelikhan closed this Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan] Improve schema metadata and documentation quality

3 participants