-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add the schema admin api #4800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the schema admin api #4800
Conversation
run Integration Tests |
run Integration Tests |
1 similar comment
run Integration Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks good. can you add tests for these endpoints?
@ApiResponse(code = 401, message = "Client is not authorized or Don't have admin permission"), | ||
@ApiResponse(code = 403, message = "Client is not authenticated"), | ||
@ApiResponse(code = 404, message = "Tenant or Namespace or Topic doesn't exist; or Schema is not found for this topic"), | ||
@ApiResponse(code = 412, message = "Failed to find the ownership for the topic"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this method return 500?
if (isNull(schemas)) { | ||
response.resume(Response.status(Response.Status.NOT_FOUND).build()); | ||
} else if (schemas.size() == 0) { | ||
response.resume(Response.status(Response.Status.NOT_FOUND).build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we return ok with an empty list? or do you have any thought about returning NOT_FOUND?
Response.ok() | ||
.encoding(MediaType.APPLICATION_JSON) | ||
.entity(GetAllVersionsSchemaResponse.builder().getSchemaResponses( | ||
schemas.stream().map(schemaAndMetadata -> GetSchemaResponse.builder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you extract the schemaAndMetadata
to GetSchemaResponse
transformation into a common method? I think it should be reused across this class.
|
||
String schemaId = buildSchemaId(tenant, namespace, topic); | ||
|
||
SchemaCompatibilityStrategy schemaCompatibilityStrategy =SchemaCompatibilityStrategy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SchemaCompatibilityStrategy schemaCompatibilityStrategy =SchemaCompatibilityStrategy | |
SchemaCompatibilityStrategy schemaCompatibilityStrategy = SchemaCompatibilityStrategy |
OK, I will add tests and fix these problems from your comment |
run Integration Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Change the Milestone to 2.4.2, because of conflict. |
Motivation
Continue the issues of #4782
Verifying this change
Add the tests for it
Does this pull request potentially affect one of the following parts:
If yes was chosen, please highlight the changes
Dependencies (does it add or upgrade a dependency): (no)
The public API: (no)
The schema: (yes)
The default values of configurations: (no)
The wire protocol: (no)
The rest endpoints: (no)
The admin cli options: (no)
Anything that affects deployment: (no)
Documentation
Does this pull request introduce a new feature? (yes / no)
If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
If a feature is not applicable for documentation, explain why?
If a feature is not documented yet in this PR, please create a followup issue for adding the documentation