@@ -21,7 +21,7 @@ class Anchor:
21
21
name : str
22
22
resource : Schema
23
23
24
- def resolve (self , resolver , uri ) -> tuple [Schema , str ]:
24
+ def resolve (self , resolver : Resolver , uri : str ) -> tuple [Schema , str ]:
25
25
return self .resource , uri
26
26
27
27
@@ -63,7 +63,7 @@ def update(self, *registries: Registry) -> Registry:
63
63
uncrawled = self ._uncrawled .update (* uncrawled ),
64
64
)
65
65
66
- def with_resource (self , resource ) -> Registry :
66
+ def with_resource (self , resource : Schema ) -> Registry :
67
67
uri = self ._specification .id_of (resource )
68
68
if uri is None :
69
69
raise UnidentifiedResource (resource )
@@ -72,7 +72,7 @@ def with_resource(self, resource) -> Registry:
72
72
def with_identified_resource (self , uri , resource ) -> Registry :
73
73
return self .with_resources ([(uri , resource )])
74
74
75
- def with_resources (self , pairs ) -> Registry :
75
+ def with_resources (self , pairs : Iterable [ tuple [ str , Schema ]] ) -> Registry :
76
76
uncrawled = self ._uncrawled
77
77
contents = self ._contents
78
78
for uri , resource in pairs :
@@ -109,7 +109,7 @@ def resource_at(self, uri: str) -> tuple[Schema, Registry]:
109
109
registry = self ._crawl ()
110
110
return registry ._contents [uri ][0 ], registry
111
111
112
- def anchors_at (self , uri ) -> PMap [str , AnchorType ]:
112
+ def anchors_at (self , uri : str ) -> PMap [str , AnchorType ]:
113
113
return self ._contents [uri ][1 ]
114
114
115
115
def _crawl (self ) -> Registry :
@@ -137,7 +137,7 @@ def _crawl(self) -> Registry:
137
137
)
138
138
return evolve (registry , uncrawled = s ())
139
139
140
- def resolver (self , root , specification ) -> Resolver :
140
+ def resolver (self , root : Schema , specification : Specification ) -> Resolver :
141
141
uri = self ._specification .id_of (root ) or ""
142
142
registry = self .with_identified_resource (uri = uri , resource = root )
143
143
registry = evolve (registry , specification = specification )
@@ -187,7 +187,7 @@ def lookup(self, ref: str) -> tuple[Schema, Resolver]:
187
187
base_uri = urljoin (self ._base_uri , id ).rstrip ("#" )
188
188
return target , self .evolve (base_uri = base_uri , registry = registry )
189
189
190
- def with_root (self , root ) -> Resolver :
190
+ def with_root (self , root : Schema ) -> Resolver :
191
191
maybe_relative = self ._registry ._specification .id_of (root )
192
192
if maybe_relative is None :
193
193
return self
0 commit comments