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 compatibility check for tuple #1347

Closed
hhkkxxx133 opened this issue Mar 15, 2021 · 1 comment
Closed

JSON compatibility check for tuple #1347

hhkkxxx133 opened this issue Mar 15, 2021 · 1 comment
Assignees
Labels
Bug Something isn't working

Comments

@hhkkxxx133
Copy link
Contributor

Hello,

I am testing the JSON compatibility check for the tuple. There are multiple cases when adding or removing items for a tuple in JSON Schema that seem incorrect.

For example,

  1. Should be backward compatible
"original": {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": [
    {
      "type": "string"
    },
    {
      "type": "number"
    }
  ],
  "additionalItems": false
},
"updated": {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": [
    {
      "type": "string"
    },
    {
      "type": "number"
    },
    {
      "type": "boolean"
    }
  ],
  "additionalItems": true
}
  1. Should be backward compatible
"original": {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": [
    {
      "type": "string"
    },
    {
      "type": "number"
    },
    {
      "type": "boolean"
    }
  ],
  "additionalItems": false
},
"updated": {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": [
    {
      "type": "string"
    },
    {
      "type": "number"
    }
  ],
  "additionalItems": true
}
  1. Should be forward compatible
"original": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": [
  {
    "type": "string"
  }
  ],
  "additionalItems": true
},
"updated": {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": [
    {
      "type": "string"
    },
    {
      "type": "number"
    }
  ],
  "additionalItems": true
}
  1. Should be backward compatible
"original": {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": [
    {
      "type": "string"
    }
  ],
  "additionalItems": false
},
"updated": {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": [
    {
      "type": "string"
    },
    {
      "type": "number"
    }
  ],
  "additionalItems": false
}
  1. Should be backward compatible
"original": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": [
  {
      "type": "string"
    },
    {
      "type": "number"
    }
  ],
  "additionalItems": false
},
"updated": {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": [
    {
      "type": "string"
    }
  ],
  "additionalItems": { "type": "number" }
}
  1. Should be forward compatible
"original": {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": [
    {
      "type": "string"
    },
    {
      "type": "number"
    }
  ],
  "additionalItems": true
},
"updated": {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": [
    {
      "type": "string"
    }
  ],
  "additionalItems": { "type": "number" }
}

Let me know what do you think.

@jsenko
Copy link
Member

jsenko commented Mar 15, 2021

I think those are valid examples and should be accepted, thanks.

@jsenko jsenko added Bug Something isn't working and removed Discussion labels Mar 15, 2021
@jsenko jsenko closed this as completed Jun 11, 2021
Apicurio Registry 2.0.x automation moved this from Backlog to Done Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

3 participants