-
-
Notifications
You must be signed in to change notification settings - Fork 59
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the issue has not already been raised
Issue
Given an origin flunet-json-schema object filtered with only/without it is not possible to set the BaseSchema's $id:
const WhizBang = fluent
.object()
.additionalProperties(false)
.id('whizbang')
.title('WhizBang')
.prop(
'whiz'
, fluent.string().required().minLength(1)
)
.prop(
'bang'
, fluent.string().required().minLength(1)
)
const part = WhizBang.only(['whiz'])
console.log(JSON.stringify(part.id('asd').valueOf(), null, 2))
Shows:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"$id": "whizbang",
"title": "WhizBang",
"properties": {
"whiz": {
+ "$id": "asd",
"type": "string",
"minLength": 1
}
},
"required": [
"whiz"
]
}I can't find a way to set the "$id": "whizbang" field.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers