Ask a Question

Conditional json path for custom rule - help please

mhiggins
Staff

Conditional json path for custom rule - help please

I need some help creating a SwaggerHub Custom Standardization Rule. 

I am looking to do the following: For every path/method that has a 200 response, I want to make sure it has a content tag in the response. 

This does not apply to any other responses and if the path/method has no 200 - then no errors should be raised. 

So something like:

  • path: $.paths.*.*.responses  <-- (only if = 200)
  • regex: /content/

Many thanks !!

cancel
Showing results for 
Search instead for 
Did you mean: