🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 3 Min Lesezeit
0

Learn Schema Validation With a Tiny GitHub Issue Fields Project

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

GitHub announced on July 2, 2026 that Issue fields are generally available, including integration with GitHub's MCP server.



Primary source: GitHub Changelog, July 2, 2026.



That creates a useful beginner project: validate structured issue metadata before an MCP client—or any program—uses it. The schema below is invented for learning. It is not GitHub's API schema.






Define three fields






CODE
// schema.mjs
export const schema = {
priority: {
kind: "singleSelect",
required: true,
options: ["P0", "P1", "P2", "P3"]
},
estimate: { kind: "number", required: false, min: 0, max: 100 },
customerImpact: { kind: "text", required: false, maxLength: 120 }
};






A schema describes both type and domain rules. estimate must be a number, but it also has to fit the range this project accepts.






Validate at the boundary






CODE
// validate.mjs
import { schema } from "./schema.mjs";

export function validate(input) {
const errors = [];
if (!input || Array.isArray(input) || typeof input !== "object") {
return ["fields must be an object"];
}

for (const [name, rule] of Object.entries(schema)) {
if (rule.required && !(name in input)) errors.push(`${name}: missing`);
}

for (const [name, value] of Object.entries(input)) {
const rule = schema[name];
if (!rule) { errors.push(`${name}: unknown field`); continue; }

if (rule.kind === "singleSelect" &&
(typeof value !== "string" || !rule.options.includes(value))) {
errors.push(`${name}: expected ${rule.options.join(", ")}`);
}
if (rule.kind === "number" &&
(typeof value !== "number" || !Number.isFinite(value) ||
value < rule.min || value > rule.max)) {
errors.push(`${name}: expected ${rule.min}..${rule.max}`);
}
if (rule.kind === "text" &&
(typeof value !== "string" || value.length > rule.maxLength)) {
errors.push(`${name}: expected at most ${rule.maxLength} characters`);
}
}
return errors;
}






Try these fixtures in a local test harness:




CODE
{"priority":"P1","estimate":8,"customerImpact":"Checkout is blocked"}









CODE
{"priority":"urgent","estimate":-4,"mysteryField":true}






The second should produce three errors. These are expected outcomes from reading the unexecuted template, not recorded test results.






Where MCP fits






CODE
MCP client
-> tool input validation
-> authorization and repository policy
-> GitHub API call






Validation is not authorization. A perfectly shaped request can still target the wrong repository or issue. A production tool also needs authenticated identity, least privilege, field discovery from official interfaces, write confirmation, rate-limit handling, and audit records.



Common beginner mistakes are checking only JSON syntax, silently converting every value, ignoring unknown fields, and copying a teaching schema into production.



After this project, you should be able to explain parsing versus validation, type versus domain constraints, and why tool schemas do not replace authorization. Issue fields provide the current topic; the durable skill is making structured tools fail clearly at their boundary.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Learn Schema Validation With a Tiny GitHub Issue Fields Project

Thematisch verwandte Begriffe: Learn, Schema, Validation, With · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...