Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-11610

Apicast policies fail to validate

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.16.0 GA
    • None
    • Gateway
    • False
    • None
    • False
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • RHOAM Sprint 70

      As part of https://issues.redhat.com/browse/THREESCALE-11530 we had to update to the latest @rjsf/core package, which uses the latest json schema validator, v8.

      In this last version of the validator, some of our apicast policies are considered invalid. This comment explains the problem: ajv-validator/ajv#1426 (comment)

      And this is how our policies are invalid, for instance, take a look at 3.15.0/policies.json: https://github.com/3scale/APIcast/blob/master/doc/policies_list/3.15.0/policies.json

      Our policy url_rewriting defines #/definitions/methods here:

      https://github.com/3scale/APIcast/blob/a63be976ce7974c3464ee74f6e2d89f32207004a/doc/policies_list/3.15.0/policies.json#L2418

      And this definition is included twice in the same policy, here:
      https://github.com/3scale/APIcast/blob/a63be976ce7974c3464ee74f6e2d89f32207004a/doc/policies_list/3.15.0/policies.json#L2378
      https://github.com/3scale/APIcast/blob/a63be976ce7974c3464ee74f6e2d89f32207004a/doc/policies_list/3.15.0/policies.json#L2318

      Due to that, the field "$id": "#/definitions/methods" is included twice in the policy. This is accepted by the v6 validator but not by v8.

              Unassigned Unassigned
              rh-ee-jlledo Joan Lledo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: