ifExists=FIND_OR_CREATE_VERSION
and firstVersion
behaviour
#6004
-
Hello. I am trying to understand the behaviour of If I create a Schema with the following AVRO content: If I create the Schema again with the same content, version "1" is returned. If I create the Schema again with a different but compatible content, there is an error: My question is, how does Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
When using The logic should be this:
You can also optionally add the I just threw together a unit test to make sure everything was working as I expected (we have tests for this already but I wanted to gather all the variants together in one place to make sure it works and to illustrate it better for you): https://gist.github.com/EricWittmann/a4b606d622b6a936ea64bbd379490408 It's possible you're doing something slightly different than this? Let me know and I will add appropriate tests. |
Beta Was this translation helpful? Give feedback.
OK so yes, if you provide a version when creating the artifact, then the call will fail if you provide a different
firstVersion
(by content) but with the same version number.In other words, if you try to create an artifact with content
XYZ
and version1.0
but an artifact with contentABC
already exists with version1.0
, the call will fail. I think that makes sense, since the server cannot do what you've asked (create a new version with different content but the same version number).If you create the artifact with content
XYZ
and version2.0
and the artifact already exists with version1.0
and contentABC
, then a new version should get created.