Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,7 @@ public class SchemaRegistryServiceImpl implements SchemaRegistryService {
@Override
@NotNull
public CompletableFuture<SchemaAndMetadata> getSchema(String schemaId) {
return getSchema(schemaId, SchemaVersion.Latest).thenApply((schema) -> {
if (schema != null && schema.schema.isDeleted()) {
return null;
} else {
return schema;
}
});
return getSchema(schemaId, SchemaVersion.Latest);
}

@Override
Expand Down Expand Up @@ -133,7 +127,17 @@ public CompletableFuture<SchemaAndMetadata> getSchema(String schemaId, SchemaVer
} else {
return Functions.bytesToSchemaInfo(stored.data)
.thenApply(Functions::schemaInfoToSchema)
.thenApply(schema -> new SchemaAndMetadata(schemaId, schema, stored.version));
.thenApply(schema -> new SchemaAndMetadata(schemaId, schema, stored.version))
.thenApply((schema) -> {
if (version == SchemaVersion.Latest) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test to show the changes make sense

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes are covered in SchemaServiceTest.java

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes are covered in SchemaServiceTest.java

@nikam14 Please add a test that shows that this change was needed. I don't see any test changes in this PR, so that is missing.

if (schema != null && schema.schema.isDeleted()) {
return null;
} else {
return schema;
}
}
return schema;
});
}
})
.whenComplete((v, t) -> {
Expand Down