-
Notifications
You must be signed in to change notification settings - Fork 28
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
Handling of new (previously None) return values #62
Comments
My current thinking is OK to add returned value that doesn't have one, but once we add for an API call they are cast in stone. If we need additional values returned later we would then introduce a new API call. Does this sound right? I'm going to code up a simple golang client to see if this holds true or if we have some wiggle room. For languages that treat JSON struct as hash it makes it easier to update, but not all languages do that. |
Well, I'm actually expecting (considering people using |
Well, what better than using the playground: https://play.golang.org/p/GSfUrNdxD3t This answered two questions for me:
There are further options that can be set if the client wants to by using |
I see a lot has been going on about API, new values etc. For starters:
Adding return value to call that hadn't one should be OK, but it will probably make sense to check behavior of major clients when this changes (libStorageManagement - that one is done in current tests). There is slight possibility that some clients may break as they are mapping json response to object - if they now expect null/None in "result" fileld, but I think thats unlikely. There are not that many clients using targetd. As for adding/changing return values or method calls in the future - maybe we should think about versioning API. In json-rpc it is possible to use dot as separator, so that may be leveraged. For example, all current calls should be able to be made as they are now, but if API changes we could add prefix, like: "v2.method" and add additional mapping to actual functions in the code based also on this version parameter (and if there is no specific mapping for API "v2" and "method" just use default one). That's basically same as @tasleson said:
|
I was also thinking at versioning the methods, not knowing the ability noted by @triluch. It seems like we share the same view of prefixing the API when a breaking change happens. |
As was remarked in #60 (and #59) the API does not utilize return values much and it would be useful to discuss how to change this.
My current interpretation is:
This issue should be used for discussing how it would be best to deal with it.
Note: the scope of this is limited to API endpoints that previously return
None
or for values added in addition to the old return values. Any API already returning values that now get a renamed return should be handled differently and is outside of this scope.The text was updated successfully, but these errors were encountered: