@@ -147,7 +147,7 @@ export interface Client {
147
147
getLatestWithMetadata ( subject : string , metadata : { [ key : string ] : string } ,
148
148
deleted : boolean , format ?: string ) : Promise < SchemaMetadata > ;
149
149
getAllVersions ( subject : string ) : Promise < number [ ] > ;
150
- getVersion ( subject : string , schema : SchemaInfo , normalize : boolean ) : Promise < number > ;
150
+ getVersion ( subject : string , schema : SchemaInfo , normalize : boolean , deleted : boolean ) : Promise < number > ;
151
151
getAllSubjects ( ) : Promise < string [ ] > ;
152
152
deleteSubject ( subject : string , permanent : boolean ) : Promise < number [ ] > ;
153
153
deleteSubjectVersion ( subject : string , version : number , permanent : boolean ) : Promise < number > ;
@@ -436,8 +436,9 @@ export class SchemaRegistryClient implements Client {
436
436
* @param schema - The schema for which to get the version.
437
437
* @param normalize - Whether to normalize the schema before getting the version.
438
438
*/
439
- async getVersion ( subject : string , schema : SchemaInfo , normalize : boolean = false ) : Promise < number > {
440
- const cacheKey = stringify ( { subject, schema : minimize ( schema ) } ) ;
439
+ async getVersion ( subject : string , schema : SchemaInfo ,
440
+ normalize : boolean = false , deleted : boolean = false ) : Promise < number > {
441
+ const cacheKey = stringify ( { subject, schema : minimize ( schema ) , deleted } ) ;
441
442
442
443
return await this . schemaToVersionMutex . runExclusive ( async ( ) => {
443
444
const cachedVersion : number | undefined = this . schemaToVersionCache . get ( cacheKey ) ;
@@ -448,7 +449,7 @@ export class SchemaRegistryClient implements Client {
448
449
subject = encodeURIComponent ( subject ) ;
449
450
450
451
const response : AxiosResponse < SchemaMetadata > = await this . restService . handleRequest (
451
- `/subjects/${ subject } ?normalize=${ normalize } ` ,
452
+ `/subjects/${ subject } ?normalize=${ normalize } &deleted= ${ deleted } ` ,
452
453
'POST' ,
453
454
schema
454
455
) ;
0 commit comments