Forum Discussion

timhilco1's avatar
5 years ago

Is there a repository of custom rules teams have implemented for standardization of their API?

One of the features of SwaggerHub we find most valuable is the ability to edit/lint the API specs. There is a rich set of rules already, but we are finding we are wanting to add our own rules that apply to our design and code generation standards.

I'm finding the jsonpath and regex rules to be very complicated beyond simple exists and matching specs. For example, we don't want designers to add 'termsOfService' node. We also want a warning where for Java Integers, the types field must be 'integer' not 'number' with a format of 'int32'. This rule is getting very complicated.

I was wondering if there is a repository or library of custom rules in the community that organizations have create for their own needs and are willing to share. This would be a community extension of what SmartBear already provides. More examples would also make it a bit easier to learn jsonpath and regex and make it easier to create new custom rules .