You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Akkurate's declarative syntax makes validation rules clear and maintainable for developers. However, non-technical stakeholders often need to understand these validation rules without reading code. Currently, there's no built-in way to generate human-readable documentation from the validation rules.
Feature Request
Add support for programmatically inspecting validation rules to enable automatic documentation generation. This would allow teams to create clear, non-technical documentation of their validation rules in formats like Markdown tables.
Example
Using the official showcase as an example:
@Validate
data classBook(
valtitle:String,
valreleaseDate:LocalDateTime,
valauthors:List<Author>,
)
@Validate
data classAuthor(valfirstName:String, vallastName:String)
// Write your validation rulesval validateBook =Validator<Book> {
// First the property, then the constraint, finally the message.
title.isNotEmpty() otherwise { "Missing title" }
releaseDate.isInPast() otherwise { "Release date must be in past" }
authors.hasSizeBetween(1..10) otherwise { "Wrong author count" }
authors.each { // Apply constraints to each author
(firstName and lastName) {
// Apply the same constraint to both properties
isNotEmpty() otherwise { "Missing name" }
}
}
}
// iterating through the rulesfor (rule in validateBook.rules) {
println("${rule.pathDescription}: ${rule.definition}")
}
Expected output
title: must not be empty
releaseDate: must be in the past
authors: must have size between 1 and 10
each authors' firstName and lastName: must not be empty
The text was updated successfully, but these errors were encountered:
Problem Statement
Akkurate's declarative syntax makes validation rules clear and maintainable for developers. However, non-technical stakeholders often need to understand these validation rules without reading code. Currently, there's no built-in way to generate human-readable documentation from the validation rules.
Feature Request
Add support for programmatically inspecting validation rules to enable automatic documentation generation. This would allow teams to create clear, non-technical documentation of their validation rules in formats like Markdown tables.
Example
Using the official showcase as an example:
Expected output
The text was updated successfully, but these errors were encountered: