Skip to main content
Mintlify
current

Search documentation

Type to search this documentation.

On this pageOverview

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:

text
🚨 Invalid docs.json:
#.logo.href: Must be a valid url
#.navbar.primary.href: Must be a valid url

Current 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 to the latest CLI version:

Bash
mint update

If 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:

Bash
mint version
mint validate
docs.json
"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

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu