Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions mockSchemaRegistryClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ func (mck *MockSchemaRegistryClient) ChangeSubjectCompatibilityLevel(string, Com
return nil, errNotImplemented
}

// DeleteSubjectCompatibilityLevel is not implemented
func (mck *MockSchemaRegistryClient) DeleteSubjectCompatibilityLevel(string) (*CompatibilityLevel, error) {
return nil, errNotImplemented
}

// GetGlobalCompatibilityLevel is not implemented
func (mck *MockSchemaRegistryClient) GetGlobalCompatibilityLevel() (*CompatibilityLevel, error) {
return nil, errNotImplemented
Expand Down
15 changes: 15 additions & 0 deletions schemaRegistryClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type ISchemaRegistryClient interface {
CreateSchema(subject string, schema string, schemaType SchemaType, references ...Reference) (*Schema, error)
LookupSchema(subject string, schema string, schemaType SchemaType, references ...Reference) (*Schema, error)
ChangeSubjectCompatibilityLevel(subject string, compatibility CompatibilityLevel) (*CompatibilityLevel, error)
DeleteSubjectCompatibilityLevel(subject string) (*CompatibilityLevel, error)
DeleteSubject(subject string, permanent bool) error
DeleteSubjectByVersion(subject string, version int, permanent bool) error
SetCredentials(username string, password string)
Expand Down Expand Up @@ -377,6 +378,20 @@ func (client *SchemaRegistryClient) ChangeSubjectCompatibilityLevel(subject stri
return &cfgChangeResp.CompatibilityLevel, nil
}

// DeleteSubjectCompatibilityLevel deletes subject-level compatibility level config and reverts to the global default.
func (client *SchemaRegistryClient) DeleteSubjectCompatibilityLevel(subject string) (*CompatibilityLevel, error) {
resp, err := client.httpRequest("DELETE", fmt.Sprintf(configBySubject, url.QueryEscape(subject)), nil)
if err != nil {
return nil, err
}
var cfgChangeResp = new(configChangeResponse)
err = json.Unmarshal(resp, &cfgChangeResp)
if err != nil {
return nil, err
}
return &cfgChangeResp.CompatibilityLevel, nil
}

// GetGlobalCompatibilityLevel returns the global compatibility level of the registry.
func (client *SchemaRegistryClient) GetGlobalCompatibilityLevel() (*CompatibilityLevel, error) {
resp, err := client.httpRequest("GET", config, nil)
Expand Down