Fix "Must be a valid url" error for logo.href or navbar.primary.href
Resolve docs.json validation errors when you use a relative path like /contact in logo.href, navbar.links, or navbar.primary.href.
When you run mint dev or mint validate with a relative path such as /contact in the logo.href, navbar.links[].href, or navbar.primary.href fields of docs.json, an outdated CLI reports errors like these:
🚨 Invalid docs.json:
#.logo.href: Must be a valid url
#.navbar.primary.href: Must be a valid urlCurrent versions of the Mintlify CLI accept both absolute URLs and relative paths that start with / in these fields. Relative paths keep links working across preview deployments, custom domains, and local previews without hardcoding your production domain.
Update the CLI
Section titled “Update the CLI”Update to the latest CLI version:
mint updateIf mint update isn't available on your version, reinstall the CLI. See Install the CLI for the reinstall commands.
Then check your version and run validation again:
mint version
mint validateExample configuration
Section titled “Example configuration”"logo": {
"light": "/logo/light.svg",
"dark": "/logo/dark.svg",
"href": "/quickstart"
},
"navbar": {
"links": [
{ "label": "Changelog", "href": "/changelog" }
],
"primary": {
"type": "button",
"label": "Contact us",
"href": "/contact"
}
}Relative paths must start with /. A value like contact without a leading slash still fails validation. The github and discord button types still require a GitHub repository URL or Discord invite URL.
For the full field reference, see logo and navbar.
Related topics