I'm investigating the possibilities of the new Data Structures syntax in API Blueprint, especially MSON. Is it possible to attach or rather specify something like a pattern (regex)? Don't found anything on this topic.
To provide regex validation for your data structure you will need to provide a JSON Schema which has this validation rule. For example, like the following:
### View a Questions Detail [GET]
+ Response 200 (application/json)
+ Attributes
+ question: `Favourite programming language?` (string)
+ Schema
{
"properties": {
"question": {
"type": "string",
"pattern": "^Favourite.*$"
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With