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

Cannot set more than 8 properties #1501

Closed
22aa96 opened this issue Mar 17, 2021 · 2 comments
Closed

Cannot set more than 8 properties #1501

22aa96 opened this issue Mar 17, 2021 · 2 comments

Comments

@22aa96
Copy link

22aa96 commented Mar 17, 2021

What version of Ajv are you using? Does the issue happen if you use the latest version?
7.2.1

JSON Schema

{
  "properties": {
    "attr1": { "type": "string" },
    "attr2": { "type": "boolean" },
    "attr3": { "type": "int8" },
    "attr4": { "type": "int8" },
    "attr5": { "type": "uint8" },
    "attr6": { "type": "int16" },
    "attr7": { "type": "uint16" },
    "attr8": { "type": "int32" },
    "attr9": { "type": "uint32" }
  }
}

Sample data

{
  "attr1": "foo",
  "attr2": true,
  "attr3": 0,
  "attr4": 0,
  "attr5": 0,
  "attr6": 0,
  "attr7": 0,
  "attr8": 0,
  "attr9": 0
}

Your code

const ajvjtd = require('ajv/dist/jtd').default;
console.log((new ajvjtd()).compile(schema)(data));

What results did you expect?
It logs false but should be true, removing any property makes it work.

Are you going to resolve the issue?
No

@epoberezkin
Copy link
Member

good catch - fixed - thank you

@epoberezkin
Copy link
Member

in 7.2.2

andriyl pushed a commit to Redocly/ajv that referenced this issue Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants