@@ -276,7 +276,10 @@ def get_by_id(self, schema_id):
276
276
# bad schema - should not happen
277
277
raise ClientError ("Received bad schema (id %s) from registry: %s" % (schema_id , e ))
278
278
279
- def get_latest_schema (self , subject ):
279
+
280
+
281
+
282
+ def get_schema_by_version (self , subject , version ):
280
283
"""
281
284
GET /subjects/(string: subject)/versions/(versionId: version)
282
285
@@ -291,7 +294,7 @@ def get_latest_schema(self, subject):
291
294
:returns: (schema_id, schema, version)
292
295
:rtype: (string, schema, int)
293
296
"""
294
- url = '/' .join ([self .url , 'subjects' , subject , 'versions' , 'latest' ])
297
+ url = '/' .join ([self .url , 'subjects' , subject , 'versions' , version ])
295
298
296
299
result , code = self ._send_request (url )
297
300
if code == 404 :
@@ -315,6 +318,25 @@ def get_latest_schema(self, subject):
315
318
316
319
self ._cache_schema (schema , schema_id , subject , version )
317
320
return (schema_id , schema , version )
321
+
322
+
323
+ def get_latest_schema (self , subject ):
324
+ """
325
+ GET /subjects/(string: subject)/versions/(versionId: version)
326
+
327
+ Return the latest 3-tuple of:
328
+ (the schema id, the parsed avro schema, the schema version)
329
+ for a particular subject.
330
+
331
+ This call always contacts the registry.
332
+
333
+ If the subject is not found, (None,None,None) is returned.
334
+ :param str subject: subject name
335
+ :returns: (schema_id, schema, version)
336
+ :rtype: (string, schema, int)
337
+ """
338
+ return self .get_schema_by_version (subject , 'latest' )
339
+
318
340
319
341
def get_version (self , subject , avro_schema ):
320
342
"""
0 commit comments