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

Sort capabilities and pretty print them. #96

Merged
merged 3 commits into from
Jan 31, 2024
Merged

Conversation

ggreer
Copy link
Contributor

@ggreer ggreer commented Jan 31, 2024

Before:

{"resourceTypeCapabilities":[{"resourceType":{"id":"role", "displayName":"Role", "traits":["TRAIT_ROLE"], "description":"A role in Snipe-IT"}, "capabilities":["CAPABILITY_SYNC"]}, {"resourceType":{"id":"user", "displayName":"User", "traits":["TRAIT_USER"], "annotations":[{"@type":"type.googleapis.com/c1.connector.v2.SkipEntitlementsAndGrants"}], "description":"A user in Snipe-IT"}, "capabilities":["CAPABILITY_SYNC"]}, {"resourceType":{"id":"group", "displayName":"Group", "traits":["TRAIT_GROUP"], "description":"A group in Snipe-IT"}, "capabilities":["CAPABILITY_SYNC", "CAPABILITY_PROVISION"]}]}

After:

{
  "@type":  "type.googleapis.com/c1.connector.v2.ConnectorCapabilities",
  "resourceTypeCapabilities":  [
    {
      "resourceType":  {
        "id":  "user",
        "displayName":  "User",
        "traits":  [
          "TRAIT_USER"
        ],
        "annotations":  [
          {
            "@type":  "type.googleapis.com/c1.connector.v2.SkipEntitlementsAndGrants"
          }
        ],
        "description":  "A user in Snipe-IT"
      },
      "capabilities":  [
        "CAPABILITY_SYNC"
      ]
    },
    {
      "resourceType":  {
        "id":  "group",
        "displayName":  "Group",
        "traits":  [
          "TRAIT_GROUP"
        ],
        "description":  "A group in Snipe-IT"
      },
      "capabilities":  [
        "CAPABILITY_SYNC",
        "CAPABILITY_PROVISION"
      ]
    },
    {
      "resourceType":  {
        "id":  "role",
        "displayName":  "Role",
        "traits":  [
          "TRAIT_ROLE"
        ],
        "description":  "A role in Snipe-IT"
      },
      "capabilities":  [
        "CAPABILITY_SYNC"
      ]
    }
  ]
}

@ggreer ggreer requested a review from jirwin as a code owner January 31, 2024 18:05
@ggreer ggreer force-pushed the ggreer/capabilities branch from 5f50d9f to 5e91708 Compare January 31, 2024 18:39
@ggreer ggreer merged commit 20d0c1d into main Jan 31, 2024
4 checks passed
@ggreer ggreer deleted the ggreer/capabilities branch January 31, 2024 18:41
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

Successfully merging this pull request may close these issues.

2 participants