csparpa
csparpa

Reputation: 546

REST API design guidelines compliance test

Given a formal specification of a REST interface - such a Swagger 2.0 file - I would like to test it at design time against a set of simple pre-defined design guidelines for the interface itself. The guidelines are composed by mandatory (MUST) and non-mandatory (SHOULD, COULD) statements, of which only the MUSTs need to be enforced.

Facts:

Examples:

Rule to be enforced: no URI of a REST API must contain the word "process"

Test Case n.1

# YAML Swagger to be tested
[...]
paths:
   /process_user/{userId}:
       [...]

# --> Outcome of test against rule: failed

Test Case n.2

# YAML Swagger n.2 to be tested**:
[...]
paths:
   /user/{userId}:
       [...]

# Outcome of test against rule**: passed

Do you know of any tool allowing to do the job?

Upvotes: 1

Views: 1015

Answers (1)

csparpa
csparpa

Reputation: 546

Posting this for convenience of the Community: user Samuel_vdc found an interesting project by Zalando called Zally, which is an "API Linter" and at current state of art validates against an hard-coded set of validation rules (Zalando's official guidelines)

It will be interesting to know - after Zally introduces support for user-provided rule sets - how those rules will be formally structured...

Upvotes: 1

Related Questions