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

Unsported oneOf keyword #14

Open
zhaoxiongfei opened this issue Mar 19, 2020 · 0 comments
Open

Unsported oneOf keyword #14

zhaoxiongfei opened this issue Mar 19, 2020 · 0 comments

Comments

@zhaoxiongfei
Copy link

zhaoxiongfei commented Mar 19, 2020

`
% cat test-schemas.js ✭
module.exports = {
oneOf: [
{
description: "add category",
type: "object",
properties: {
key: {
description: "category",
type: "string",
enum: ["category"]
},
value: {
type: ["object"],
required: ["name"],
properties: {
name: {
description: "name",
type: "string",
maxLength: 20
},
isHidden: {
description: "hiddend?",
type: "string",
enum: ["yes", "no"],
defaultValue: "no"
}
}
}
},
required: ["key", "value"],
additionalProperties: false
},
{
description: "add tag",
type: "object",
properties: {
key: {
description: "category",
type: "string",
enum: ["tag"]
},
value: {
type: "array",
maxItems: 20,
items: {
description: "name of tag",
type: "string",
maxLength: 10
}
}
},
required: ["key", "value"],
additionalProperties: false
}
]
};
[redstone@RedstoneZhaodeMacBook-Pro:~/data/github/mingpian/domain on master]
% node ✭

parse = require('json-schema-to-markdown')
[Function]
schema = require('./test-schemas');
{ oneOf:
[ { description: 'add category',
type: 'object',
properties: [Object],
required: [Array],
additionalProperties: false },
{ description: 'add tag',
type: 'object',
properties: [Object],
required: [Array],
additionalProperties: false } ] }
console.log(parse(schema));

The object must be one of the following types:

  • undefined
  • undefined
    `
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

No branches or pull requests

1 participant