You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if we do a POST request towards /topics/topic_name with only the key_schema, value_schema and the records in the body of the request we implicitly create a Subject associated to the topic.
I think doing this implicitly without a flag is dangerous and can lead users to create new Subject even if they don't realize it.
It also creates different behaviour in the request based on the absence/presence of fields.
An example of that was related to the issue #720.
If we try to produce by specifying the id's of the key and the value we get back an error because the subject do not have the -key and the -value postfix.
Otherwise, if we get rid of the ids in the request and we include the schema, the schema registry proceed automatically with creating the new subjects giving the false impression that the previous registration of the Subject was responsible for the message produced.
This works fine (by implicitly creating two new subjects), instead if we keep the same code but we replace the body with the following one, it give us the error that the subjects aren't registered (this works the same even if we get rid of the key_schema and the value_schema):
Currently if we do a POST request towards
/topics/topic_name
with only thekey_schema
,value_schema
and therecords
in the body of the request we implicitly create a Subject associated to the topic.I think doing this implicitly without a flag is dangerous and can lead users to create new Subject even if they don't realize it.
It also creates different behaviour in the request based on the absence/presence of fields.
An example of that was related to the issue #720.
If we try to produce by specifying the id's of the key and the value we get back an error because the subject do not have the
-key
and the-value
postfix.Otherwise, if we get rid of the ids in the request and we include the schema, the schema registry proceed automatically with creating the new subjects giving the false impression that the previous registration of the Subject was responsible for the message produced.
Code to replicate the issue:
This works fine (by implicitly creating two new subjects), instead if we keep the same code but we replace the body with the following one, it give us the error that the subjects aren't registered (this works the same even if we get rid of the
key_schema
and thevalue_schema
):The correct way of registering the subjects and deal with it it's the following:
That works fine in both ways, if we include the ids or if we include the schemas.
I suggest to unify the behaviour by explicitly adding a field when we want an upsert semantics for the Subjects
The text was updated successfully, but these errors were encountered: