Verify API Schema
Testing & Qualityverify-api-schemaVerify API Schema is an Agent Skill for testing & quality published in the GoogleCloudPlatform/magic-modules repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Verify if an MMv1 YAML property matches the live GCP REST API JSON payload using the Discovery Documents.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/GoogleCloudPlatform/magic-modules/blob/HEAD/.agents/skills/utils/verify-api-schema/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/verify-api-schema, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
verify-api-schema
Note to AI Agents: You MUST read the YAML frontmatter above first. Only read the rest of this file if the
descriptionmatches your current roadblock or required task.
Prerequisites
- You must be in the
magic-modulesroot directory. - You must have
curlandjqinstalled.
Execution Steps
1. Verification
Provide the exact bash commands the agent should run to verify the prerequisites.
Verify jq installation
jq --version
2. The Core Commands
Query the live GCP Discovery Documents directly. This is the ultimate source of truth for exact JSON payload names (including weird edge cases like double-plurals or typos in the API).
Query exact schema in v1 or beta
# For v1 Compute API schema
curl -s https://www.googleapis.com/discovery/v1/apis/compute/v1/rest | jq '.schemas.SecurityPolicyRule'
# For beta Compute API schema
curl -s https://www.googleapis.com/discovery/v1/apis/compute/beta/rest | jq '.schemas.SecurityPolicyRule'
Replace SecurityPolicyRule with the specific schema name you are tracking (e.g., UrlMap, BackendService).
3. Verification & Handoff
Instructions on how the agent should verify the command succeeded, and what workflow or rule it should return to next.
- Compare the JSON payload attributes (types, names, pluralization) with the Magic Modules YAML properties.
- If you find a discrepancy (e.g.,
exclusionsin JSON vsexclusionin YAML), verify ifapi_nameis being used to bridge the gap.