diff --git a/src/jsonspec/reference/providers.py b/src/jsonspec/reference/providers.py
index <HASH>..<HASH> 100644
--- a/src/jsonspec/reference/providers.py
+++ b/src/jsonspec/reference/providers.py
@@ -105,6 +105,11 @@ class FilesystemProvider(Provider):
                 spec = filename[l:-5]
                 with open(filename, 'r') as file:
                     schema = json.load(file)
+
+                # Let's assume the schema knows its name more accurately than its path can provide.
+                if schema.get('id'):
+                    spec = schema['id']
+
                 data[spec] = schema
 
             # set the fallbacks
FilesystemProvider reads the "id" field if exists.