Creating custom ruleset for API Governance

123 Views Asked by At

I'm trying to create custom ruleset to check if client-id-auth(basic authentication) is included for all end points in RAML. But this ruleset is not working as expected, even after including client-id-auth in trait, its showing error, I think i am missing something while writing ruleset.

Ruleset:

client-id-auth-check:
    message: All endpoints must use the client-id-auth trait
    targetClass: apiContract.EndPoint
    propertyConstraints:
      apiContract.ParametrizedTrait:
        name: client-id-auth
        minCount : 1

RAML:

#%RAML 1.0
title: Compliant API

traits:
  client-id-auth:
    description: This trait represents the client ID authentication requirement.

/users:
  get:
    is: [client-id-auth]
    responses:
      200:
        description: Successfully retrieved users.
0

There are 0 best solutions below