Search code examples
urirfcrfc3986

Clarification on URI path component?


According to RFC 3986 Section 3 - Syntax Components:

The scheme and path components are required, though the path may be empty (no characters).

Can someone clarify how the path component can be required if it's able to be empty? Maybe I'm misunderstanding the definition of "required" in this context, but I assumed it to mean something along the lines of "must be non-empty," which obviously conflicts with the spec here.


Solution

  • Here, "required" means merely "always present": the scheme and path components of an absolute URI are always present.

    The scheme component can't be empty because the production "scheme" requires at least one character.

    The path component can be empty because the production "path-empty" (part of "hier-part") consists of zero characters.