0

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

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.
  • Welcome to Stack Overflow! Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the [How to Ask page](https://stackoverflow.com/help/how-to-ask) for help clarifying this question. Include the desired behavior, a specific problem or error and the shortest code necessary to reproduce the issue. See also [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – aled Aug 08 '23 at 15:16
  • Thank you @aled - I have added more details now. – user1969720 Aug 09 '23 at 14:47
  • Which errors are you seeing? You should add the details to understand what is not working. – aled Aug 09 '23 at 14:54
  • Since i added client-id-auth trait in my RAML, it should not show this message in design center -'All endpoints must use the client-id-auth trait' as defined in ruleset, so my problem is why its showing this message even after adding client-id-auth, is there any problem in my ruleset? – user1969720 Aug 09 '23 at 16:06
  • @aled Please let me know if you need more details. – user1969720 Aug 11 '23 at 10:32

0 Answers0