{"id":48262840,"url":"https://github.com/ingka-group/asyncapi-payload-validator","last_synced_at":"2026-04-04T21:38:19.654Z","repository":{"id":340943677,"uuid":"1096408651","full_name":"ingka-group/asyncapi-payload-validator","owner":"ingka-group","description":"A Python tool for validating JSON message payloads against AsyncAPI specifications. Performs detailed JSON Schema validation including type checking, constraints, patterns, enums, and composition rules.","archived":false,"fork":false,"pushed_at":"2026-03-09T09:15:39.000Z","size":96,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-09T13:55:44.741Z","etag":null,"topics":["asyncapi","contract-testing","event-api"],"latest_commit_sha":null,"homepage":"https://github.com/ingka-group/asyncapi-payload-validator","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ingka-group.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-14T11:35:38.000Z","updated_at":"2026-03-09T09:15:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ingka-group/asyncapi-payload-validator","commit_stats":null,"previous_names":["ingka-group/asyncapi-payload-validator"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ingka-group/asyncapi-payload-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingka-group%2Fasyncapi-payload-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingka-group%2Fasyncapi-payload-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingka-group%2Fasyncapi-payload-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingka-group%2Fasyncapi-payload-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ingka-group","download_url":"https://codeload.github.com/ingka-group/asyncapi-payload-validator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingka-group%2Fasyncapi-payload-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31415113,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncapi","contract-testing","event-api"],"created_at":"2026-04-04T21:38:17.349Z","updated_at":"2026-04-04T21:38:19.646Z","avatar_url":"https://github.com/ingka-group.png","language":"Python","readme":"# AsyncAPI Payload Validator\n\n[![PyPI version](https://img.shields.io/pypi/v/asyncapi-payload-validator.svg)](https://pypi.org/project/asyncapi-payload-validator/)\n[![Python Support](https://img.shields.io/pypi/pyversions/asyncapi-payload-validator.svg)](https://pypi.org/project/asyncapi-payload-validator/)\n[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PyPI Downloads](https://static.pepy.tech/personalized-badge/asyncapi-payload-validator?period=total\u0026units=INTERNATIONAL_SYSTEM\u0026left_color=BLACK\u0026right_color=GREEN\u0026left_text=downloads)](https://pepy.tech/projects/asyncapi-payload-validator)\n\nA Python tool for validating JSON message payloads against AsyncAPI specifications. Performs detailed JSON Schema validation including type checking, constraints, patterns, enums, and composition rules.\n\n## Features\n\n- **Comprehensive validation** - types, required fields, string length, patterns, enums, numeric constraints, oneOf/anyOf/allOf\n- **Lenient type coercion** - string numbers and booleans accepted where appropriate\n- **AsyncAPI 2.x and 3.x** - supports both specification versions\n- **HTML reports** - detailed reports with line-by-line source highlighting\n- **Jinja2 templates** - validate template structure before rendering\n- **CI/CD ready** - exit codes, GitHub Actions and GitLab CI examples\n\n## Installation\n\n```bash\npip install asyncapi-payload-validator\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eInstall from source\u003c/summary\u003e\n\n```bash\ngit clone https://github.com/ingka-group/asyncapi-payload-validator.git\ncd asyncapi-payload-validator\npip install .\n```\n\nFor development: `pip install -e \".[dev]\"`\n\u003c/details\u003e\n\n## Quick Start\n\n### Command Line\n\n```bash\n# Basic validation\nasyncapi-validate payload.json asyncapi-spec.yaml\n\n# Generate HTML report\nasyncapi-validate payload.json asyncapi-spec.yaml --html-report report.html\n\n# Validate specific message by ID\nasyncapi-validate payload.json asyncapi-spec.yaml --message-id UserSignedUp\n\n# Validate Jinja2 template structure\nasyncapi-validate template.json spec.yaml --render-jinja2\n\n# Validate rendered template with context\nasyncapi-validate template.json spec.yaml --render-jinja2 --jinja2-context context.json\n```\n\n### Python Library\n\n```python\nimport json, yaml\nfrom pathlib import Path\nfrom asyncapi_payload_validator import validate_payload\n\npayload = json.loads(Path('payload.json').read_text())\nspec = yaml.safe_load(Path('asyncapi.yaml').read_text())\n\nresult = validate_payload(payload, spec)\n\nif result['valid']:\n    print(\"Validation passed!\")\nelse:\n    print(f\"{result['summary']['total_violations']} violation(s)\")\n    for category, violations in result['violations'].items():\n        for v in violations:\n            print(f\"  - {v}\")\n```\n\nSee [Python API Reference](docs/python-api.md) for the full API, return value structure, and advanced usage.\n\n## Validation Rules\n\n| Icon | Category | Description |\n|------|----------|-------------|\n| ➕ | Extra Attributes | Fields in payload not declared in schema |\n| ❌ | Type Mismatches | Incorrect data types (with lenient coercion) |\n| 🚫 | Missing Required | Required fields absent from payload |\n| ↔️ | Length Violations | String minLength/maxLength constraints |\n| #️⃣ | Pattern Violations | Regex pattern mismatches |\n| ✅ | Enum Violations | Values not in allowed enum list |\n| 🔢 | Numeric Violations | min/max/multipleOf constraints |\n| 🧩 | Composition Violations | oneOf/anyOf/allOf rule failures |\n\n## Exit Codes\n\n| Code | Meaning |\n|------|---------|\n| `0` | Validation passed |\n| `1` | Validation failed (violations found) |\n| `2` | Error (invalid arguments, file not found) |\n| `130` | Cancelled by user (Ctrl+C) |\n\n## Documentation\n\n| Guide | Description |\n|-------|-------------|\n| [Examples and Output](docs/examples.md) | Output format, real-world examples, icon reference |\n| [Python API](docs/python-api.md) | Programmatic usage, return structure, individual functions |\n| [CI/CD Integration](docs/ci-cd.md) | GitHub Actions, GitLab CI examples |\n| [Advanced Features](docs/advanced.md) | Jinja2 templates, type coercion, composition, troubleshooting |\n\n## Contributing\n\nContributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nMIT - see [LICENCE.md](LICENCE.md) for details.\n\n## Links\n\n- **PyPI**: https://pypi.org/project/asyncapi-payload-validator/\n- **GitHub**: https://github.com/ingka-group/asyncapi-payload-validator\n- **Issues**: https://github.com/ingka-group/asyncapi-payload-validator/issues\n- **AsyncAPI Spec**: https://v2.asyncapi.com/docs/reference/specification/v2.6.0\n- **Changelog**: [CHANGELOG.md](CHANGELOG.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fingka-group%2Fasyncapi-payload-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fingka-group%2Fasyncapi-payload-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fingka-group%2Fasyncapi-payload-validator/lists"}