Conversation
Pull Request Test Coverage Report for Build 7673994061
💛 - Coveralls |
| describe('compose keywords', () => { | ||
| const ajv = new Ajv() | ||
| const ajv = new Ajv({ | ||
| allowUnionTypes: true |
There was a problem hiding this comment.
Because ajv will warn and spam the log output, because here type will be integer and string.
| properties: { foo: { type: 'string', anyOf: [{ type: 'string' }] } }, | ||
| type: 'object' | ||
| }) | ||
| }) |
There was a problem hiding this comment.
Can you add a similar test for oneOf?
|
Looking at the change, this seems counterintuitive. Why specifying the same thing twice? |
|
I just implemented it to fix the reported issue. If ajv strict is warning, because type is missing, then i guess it needs to be added, even if it is twice. Should I continue on this PR or should we wait for more feedback? |
|
Looking at it, it doesn't seems something we should fix. I've actually never used type with anyOf. |
|
I've not found any JSONSchema specs that actually requires "type" with oneOf/anyOf.. maybe we should consider raising #233 on AJV side? |
|
Closing due to inactivity. |
I've been waiting for some reply on this.. I have still a lot of spam in my logs for this issue.. |
https://json-schema.org/understanding-json-schema/reference/combining#factoringschemas
|
Resolves #233
Checklist
npm run testandnpm run benchmarkand the Code of conduct