Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error for SCIM-compliant schema (object containing $ref attribute) #661

Open
apestov opened this issue Apr 24, 2024 · 0 comments
Open

Comments

@apestov
Copy link

apestov commented Apr 24, 2024

A runtime error is thrown when validating a schema of a SCIM-compliant API (System for Cross-domain Identity Management, RFC 7643, 7644, 7642).

Steps to reproduce:

  1. Download OpenAPI File for Atlassian provisioning REST API ( https://developer.atlassian.com/cloud/admin/user-provisioning/rest/intro/ ) as an example SCIM-based API definition.

  2. Execute npx ibm-openapi-validator -r default swagger.v3.json

  3. Observed behavior: the app unexpectedly exits with a runtime error.

IBM OpenAPI Validator (validator: 1.16.10), @Copyright IBM Corporation 2017, 2024.

Validation Results for swagger.v3.json:

[ERROR] There was a problem with spectral.
[ERROR] Error running Nimma
[ERROR] Additional error details:
[ERROR] Cause: $ref.startsWith is not a function
[ERROR] At: checkForCircularRef (@ibm-cloud\openapi-ruleset\src\functions\circular-refs.js:65:13)

SCIM Background

SCIM data model uses $ref as an attribute name that could be a confusion for OpenAPI-tools.

The OpenAPI file mentioned in reproduction step 1 contains declaration for the resource per standard with $ref attribute as follows:

  "ScimGroupMember": {
    "type": "object",
    "title": "Scim group member",
    "properties": {
      "$ref": {
        "type": "string",
        "readOnly": true
      },
      ...
    },
    "description": "SCIM group member"
  }

RFC snippet for populated SCIM-resource:

{
  "groups": [
    {
      "value": "e9e30dba-f08f-4109-8486-d5c6a331660a",
      "$ref": "../Groups/e9e30dba-f08f-4109-8486-d5c6a331660a",
      "display": "Tour Guides"
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant