Skip to content
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

Return values for /property path #2

Open
balmas opened this issue Apr 25, 2017 · 9 comments
Open

Return values for /property path #2

balmas opened this issue Apr 25, 2017 · 9 comments

Comments

@balmas
Copy link
Contributor

balmas commented Apr 25, 2017

copied from RDACollectionsWG/rda_collections_api#4

@fbaumgardt says:
The spec describes a whole MemberItem as return value for a GET on properties. Is this desired? I could see this make sense on PUT or POST - receive the updated member - but for GET I would probably expect a single value (or object or array).

Thoughts?

@TobiasWeigel responds:
Yes, I agree that this is not consistent. Looking at the corresponding PUT I am also not sure whether the memberItem record even makes sense there. Wouldn't I just call PUT on one specific property, like ../properties/location? A PUT with the full MemberItem record would then only make sense for the root, /properties.

@balmas
Copy link
Contributor Author

balmas commented Apr 25, 2017

we are agreed to make this change.

@fbaumgardt
Copy link
Member

Apparently we need to migrate to OpenAPI 3.0 for this. The response schema for single values from /property would need to specify all possible value types, and the current version (2.0) does not allow for multiple types per schema: OAI/OpenAPI-Specification#270. This is solved in 3.0

@fbaumgardt
Copy link
Member

Added a draft for OpenAPI 3.0 here: https://github.com/RDACollectionsWG/apidocs/tree/OpenAPI3.0

@fbaumgardt
Copy link
Member

fbaumgardt commented May 8, 2017

While editing the specs files I was wondering about DELETE -- should we return the modified MemberItem, similar to PUT?

Edit: I should add that this isn't a recommendation, but really just a question. I'd like to think through the benefits of either solution.

@balmas
Copy link
Contributor Author

balmas commented May 9, 2017

Re DELETE return value. It could make sense. it could also make sense to return the # of items deleted, in thinking about future versions which might allow for multiple deletions to occur in a single operation. I guess one advantage of returning the deleted item might that it allows the client to rollback the deletion more easily if needed.

@balmas
Copy link
Contributor Author

balmas commented May 9, 2017

related to this -- perhaps Member POST should also return the Member Item rather than an empty response. If the Service supports ID minting for Member Items presumably the returned item would include the new ID. (I fear I'm opening a can of worms with this point though...)

@balmas
Copy link
Contributor Author

balmas commented May 9, 2017

According to the swagger 2.0 specification, leaving schema out of the response means that there is no return value. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#responseObject

So per our discussion today, for the initial release of the API will leave this returning MemberItem and enter an issue for the future to upgrade to Open API 3.0 so that we can specify returning the property value with multiple types.

Separate issues will also be opened for the DELETE and POST discussions above.

@balmas balmas closed this as completed May 9, 2017
@balmas balmas reopened this May 9, 2017
@balmas
Copy link
Contributor Author

balmas commented May 9, 2017

Marking as enhancement and out of scope for initial release.

This was referenced May 9, 2017
@fbaumgardt
Copy link
Member

fbaumgardt commented May 9, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants