router
router copied to clipboard
chore: Update jsonschema usage
Hey!
This PR updates the jsonschema crate and applies its newer APIs.
@Stranger6667: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/
✅ Docs Preview Ready
No new or changed pages found.
That's awesome, thank you!
It looks like some of our generated definitions have naming that isn't allowed in a uri-reference anymore (things like #/definitions/apollo_router::Extendable<RouterStage>).
Does jsonschema support URL-encoded references? Should it work if we produced something like this instead?
{
"definitions": { "apollo_router::Extendable<RouterStage>": { /* omitted */ } }
}
// elsewhere...
{
"$ref": "#/definitions/apollo_router%3A%3AExtendable%3CRouterStage%3E"
}
@goto-bus-stop
I think it should support them, yep :) I haven't tried it myself, though
Is there a test failure because of this?
Yeah, there's a failure because the schema generated by schemars uses ,: <> characters in definitions and references. It seems that some of those characters were accepted in uri references by the old version of jsonschema we have in use at the moment, but not in the new version.
Don't worry if that's not something you want to look into, I've put it on my list so I'll take a look at patching it up on our end soon
@Stranger6667 Is this something you think you'll get a chance to look at, or do you think it's better for @goto-bus-stop to take a look at some point?
@abernix I don't have the bandwidth this week, but I can take a look a bit later
I'll rebase this after https://github.com/apollographql/router/pull/7893 lands.