Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate publications with json schema #133

Merged
merged 3 commits into from
Nov 7, 2024

Conversation

rjzondervan
Copy link

@rjzondervan rjzondervan commented Nov 6, 2024

This adds the functionality to validate the data-field in a publication with JSON-schema definitions built in the publication type.

If there are no validation errors the field validation remains empty, while it will return data if there are validation errors. These errors follow the following form:

{
    "/": ["the required properties (date) are missing"],
    "/date": ["The data must match the 'date' format"]
}

Please note that if there is an error on root level (like a missing parameter), the validator will not progress. (That means that the object above can never happen this way, so that object is just for illustrative purposes).

lib/Db/PublicationType.php Outdated Show resolved Hide resolved
lib/Service/ObjectService.php Outdated Show resolved Hide resolved
lib/Service/ValidationService.php Outdated Show resolved Hide resolved
lib/Service/ValidationService.php Outdated Show resolved Hide resolved
@rjzondervan rjzondervan merged commit d673b25 into development Nov 7, 2024
1 check passed
rjzondervan added a commit that referenced this pull request Nov 8, 2024
…alidate-publication"

This reverts commit d673b25, reversing
changes made to 0d52bef.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants