Contributions
Re: Standardization: Custom rule which ensures that at least one server url matches a pattern
Thanks, but your solution seems to be too static for my use case. My given example was really just an example to simulate the problem, but in reality the APIs can look quite different. My only goal is to make sure that the one server url is present an nothing more. It just does not feel right, to enforce a certain order of server urls inside all of these APIs just to make one standardization rule work. Is there no other solution? Or is there maybe a chance that the 'path exists' feature will support expressions in the future?1.5KViews0likes1CommentStandardization: Custom rule which ensures that at least one server url matches a pattern
I am trying to create a custom rule which ensures that there is at least one server url which matches a certain pattern (https://{host}/mypath). My test API looks like this: ... servers: - description: SwaggerHub API Auto Mocking url: https://myswaggerhub/virts/myorg/myapi/1.0.0 - url: 'https://{host}/mypath' variables: host: enum: - 'myfirsthost:443' - 'mysecondhost:443' default: 'myfirsthost:443' ... I tried the following: 1) Create a JSONPath matching my mandatory URL which must exists. Unfortunately, 'path exists' does not support expressions (see attached image namedcustom_rule_1.png) 2) Create a JSONPath matching all urls and add a regex to match my mandatory URL. Unfortunately, this also excludes all other URLs (see attached image named custom_rule_2.png) 3) Create a JSONPath matching all urls and add a regex to match my mandatory URL or any other URL. Unfortunately, this does not enforce that my mandatory URL must be present (see attached image named custom_rule_3.png1.7KViews0likes3Comments