It would also make is easier for third party software (other forges or any other) to create such files for Gitea to ingest. Or use files dumped by Gitea for other purposes. The schema used for validation can also include a documentation and it could grow into a de-facto file format.
To illustrate this, a diff implements this idea for issues only but it would be trivial to similarly cover other data structures.
- The –validation option is added to restore-repo
- JSON schema describes issues, labels and reactions
- A helper loads the YAML dump file and optionally (if --validation is set) validates its content against the corresponding schema.
- The helper is used in RestoreRepo and helps keep it DRY
- The schemas are added in a bindata file to be used in the binary
- Tests verify validation border cases and error conditions
How do people feel about going in this direction?