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

json-schema invalid (maybe) #1

Closed
riccardo-forina opened this issue Apr 28, 2021 · 0 comments · Fixed by apache/camel-kamelets#188
Closed

json-schema invalid (maybe) #1

riccardo-forina opened this issue Apr 28, 2021 · 0 comments · Fixed by apache/camel-kamelets#188

Comments

@riccardo-forina
Copy link

I'm using ajv to validate the json-schema from a connector and build a form for it. It looks like the schema is invalid because the top level object is missing the type property.

This doesn't work

{
  "description": "Receive messages from a Slack channel.",
  "properties": {
    "channel": {
      "description": "The Slack channel to receive messages from",
      "example": "#myroom",
      "title": "Channel",
      "type": "string"
    },
    "token": {
      "description": "The token to access Slack. A Slack app is needed. This app needs to have channels:history and channels:read permissions. The Bot User OAuth Access Token is the kind of token needed.",
      "title": "Token",
      "type": "string",
      "x-descriptors": [
        "urn:alm:descriptor:com.tectonic.ui:password"
      ]
    }
  },
  "required": [
    "channel",
    "token"
  ],
  "title": "Slack Source"
}
This does work

{
  "description": "Receive messages from a Slack channel.",
  "properties": {
    "channel": {
      "description": "The Slack channel to receive messages from",
      "example": "#myroom",
      "title": "Channel",
      "type": "string"
    },
    "token": {
      "description": "The token to access Slack. A Slack app is needed. This app needs to have channels:history and channels:read permissions. The Bot User OAuth Access Token is the kind of token needed.",
      "title": "Token",
      "type": "string",
      "x-descriptors": [
        "urn:alm:descriptor:com.tectonic.ui:password"
      ]
    }
  },
  "required": [
    "channel",
    "token"
  ],
  "title": "Slack Source",
  "type": "object"
}

Note the final "type": "object" property

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 a pull request may close this issue.

1 participant