@@ -257,16 +257,15 @@ export abstract class Serializer extends Serde {
257
257
id = await this . client . register ( subject , info , Boolean ( normalizeSchema ) )
258
258
} else if ( useSchemaId != null && useSchemaId >= 0 ) {
259
259
info = await this . client . getBySubjectAndId ( subject , useSchemaId , format )
260
- id = await this . client . getId ( subject , info , false )
261
- if ( id !== useSchemaId ) {
262
- throw new SerializationError ( `failed to match schema ID (${ id } != ${ useSchemaId } )` )
263
- }
260
+ id = useSchemaId
264
261
} else if ( useLatestWithMetadata != null && Object . keys ( useLatestWithMetadata ) . length !== 0 ) {
265
- info = await this . client . getLatestWithMetadata ( subject , useLatestWithMetadata , true , format )
266
- id = await this . client . getId ( subject , info , false )
262
+ let metadata = await this . client . getLatestWithMetadata ( subject , useLatestWithMetadata , true , format )
263
+ info = metadata
264
+ id = metadata . id
267
265
} else if ( useLatest ) {
268
- info = await this . client . getLatestSchemaMetadata ( subject , format )
269
- id = await this . client . getId ( subject , info , false )
266
+ let metadata = await this . client . getLatestSchemaMetadata ( subject , format )
267
+ info = metadata
268
+ id = metadata . id
270
269
} else {
271
270
id = await this . client . getId ( subject , info , Boolean ( normalizeSchema ) )
272
271
}
0 commit comments