Vant skill test contract
Skill dhaupin/vant/models/public/skills/vant-skill-test-contract
Verify API schemas and contracts match expected format. Validate request/response structures. Use when testing APIs, before integration, or after schema changes.From its SKILL.md
npx -y skills add dhaupin/vant --skill vant-skill-test-contractAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 9 stars9 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
1.4 KB, 309 tokens by cl100k_base, as published. Nobody here has run it
Test Contract
API schema validation.
When To Use
- API testing
- Before integration
- After schema changes
What To Test
1. Request Schema
const requestSchema = {
type: 'object',
required: ['email', 'password'],
properties: {
email: { type: 'string', format: 'email' },
password: { type: 'string', minLength: 8 }
}
}
2. Response Schema
const responseSchema = {
type: 'object',
required: ['id', 'email'],
properties: {
id: { type: 'string' },
email: { type: 'string' }
}
}
3. Validate
const Ajv = require('ajv')
const ajv = new Ajv()
const validate = ajv.compile(requestSchema)
const valid = validate(requestBody)
Tools
| Tool | Use |
|---|---|
| ajv | JSON Schema validation |
| json-schema-validator | Node validation |
| Swagger/OpenAPI | API spec validation |
Output
## Contract Tests
| Schema | Valid |
|--------|-------|
| Request | [PASS/FAIL] |
| Response | [PASS/FAIL] |
### Errors
- [n] violations
Role: Contract Tester
Input: Schema + Data
Output: Validation results
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.