1

In our project, we have create a repository. The repository has 100s of JSON and XML files. We have written XML and JSON Validators and define schema to validate XML and JSON files. Employee will update XML and JSON file and send merge requests. There are chances that they violate schema definitions. We would like to catch this and do not allow to merge such changes.

So, we are writing a Job - validate-schema. This job should validate Schema of all XML and JSON files against the Schema definition specified inside the repository.

Is there a way in Gitlab itself to do such validation? Otherwise, it seems we need to write a third party program to valid this schema and call then inside validate-schema job.

Vishal
  • 339
  • 1
  • 9
  • 26
  • You mentioned "we have written XML and JSON validators" so why do you need a built-in GitLab validator? – DV82XL Jul 14 '20 at 13:29
  • Ideally the user doing the merge request has pre-validated for (1) XML or JSON correctness and (2) any schema definitions. Are you saying you want the "build" to fail if there's an issue, and that you're looking for something out of the box in gitlab? – gurpal2000 Apr 14 '21 at 19:38

1 Answers1

0

Ideally the user doing the merge request has pre-validated for (1) XML or JSON correctness and (2) any schema definitions.

If you want the build/pipeline to fail if there's an issue, then you could consider running a gitlab 'job' at merge request time - this question might be helpful

gurpal2000
  • 1,004
  • 1
  • 17
  • 35