@@ -147,7 +147,7 @@ export interface Client {
147147 getLatestWithMetadata ( subject : string , metadata : { [ key : string ] : string } ,
148148 deleted : boolean , format ?: string ) : Promise < SchemaMetadata > ;
149149 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 > ;
151151 getAllSubjects ( ) : Promise < string [ ] > ;
152152 deleteSubject ( subject : string , permanent : boolean ) : Promise < number [ ] > ;
153153 deleteSubjectVersion ( subject : string , version : number , permanent : boolean ) : Promise < number > ;
@@ -436,8 +436,9 @@ export class SchemaRegistryClient implements Client {
436436 * @param schema - The schema for which to get the version.
437437 * @param normalize - Whether to normalize the schema before getting the version.
438438 */
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 } ) ;
441442
442443 return await this . schemaToVersionMutex . runExclusive ( async ( ) => {
443444 const cachedVersion : number | undefined = this . schemaToVersionCache . get ( cacheKey ) ;
@@ -448,7 +449,7 @@ export class SchemaRegistryClient implements Client {
448449 subject = encodeURIComponent ( subject ) ;
449450
450451 const response : AxiosResponse < SchemaMetadata > = await this . restService . handleRequest (
451- `/subjects/${ subject } ?normalize=${ normalize } ` ,
452+ `/subjects/${ subject } ?normalize=${ normalize } &deleted= ${ deleted } ` ,
452453 'POST' ,
453454 schema
454455 ) ;
0 commit comments