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

Use schema to validate document.commit in knowledge is a 40 char hexadecimal SHA value #30

Open
bjhargrave opened this issue Jun 13, 2024 · 2 comments

Comments

@bjhargrave
Copy link
Contributor

In the taxonomy repo, there is discussion about further validation of the document information in a knowledge contribution. One thing the schema can do is validate that the document.commit value is a 40 char hexadecimal SHA value.

See https://json-schema.org/understanding-json-schema/reference/string#regexp

@bjhargrave
Copy link
Contributor Author

bjhargrave commented Jun 13, 2024

We could required the commit value to always be 40 chars. This would be an issue for some existing knowledge documents.

{  
  "type": "string",
  "pattern": "^[a-fA-F0-9]{40}$"
}

Or we could allow it to be between 7 and 40 chars. This should validate any existing knowledge documents.

{  
  "type": "string",
  "pattern": "^[a-fA-F0-9]{7,40}$"
}

@bjhargrave
Copy link
Contributor Author

My latest thinking is that we do not want to do this detailed validation. I think at some point we will need to allow the knowledge markdown to live in the taxonomy repo alongside the qna.yaml. Then we will need a "special" commit value to indicate the knowledge is in the same commit as its peer qna.yaml.

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

No branches or pull requests

1 participant