Is there a way to select an array member the value of a key with JSON Pointer? So for this JSON Schema:
"links":[
{
"title": "Create",
"href": "/book",
"method": "POST",
"schema": {}
},
{
"title": "Get",
"href": "/book",
"method": "GET",
"schema": {}
}
]
Instead of:
links/0/schema
I would like to be able to do:
links/{title=GET}/schema
Apparently not. So I did this:
const links = schema.links;
let ref;
for (const [i, link] of links.entries()) {
if (link.href === req.originalUrl && link.method === req.method) {
ref = `schema.json#/links/${i}/schema`;
break;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With