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 newly created space in response #2610

Merged
merged 1 commit into from
Oct 12, 2021
Merged

return newly created space in response #2610

merged 1 commit into from
Oct 12, 2021

Conversation

C0rby
Copy link
Contributor

@C0rby C0rby commented Oct 12, 2021

Description

Added the newly created space in the response for CreateSpace and changed the response code to 201. Before the response was empty and returned a 200 OK.

Requires this Reva change: cs3org/reva#2158

Motivation and Context

This is compatible to what Microsoft is doing in the Graph API:
https://docs.microsoft.com/en-us/graph/api/user-post-users?view=graph-rest-1.0&tabs=http#response-1
https://docs.microsoft.com/en-us/graph/api/user-post-calendars?view=graph-rest-1.0&tabs=http#response-1

How Has This Been Tested?

  • locally in the graph explorer

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@C0rby C0rby requested review from refs, micbar and butonic October 12, 2021 09:11
@C0rby C0rby self-assigned this Oct 12, 2021
@C0rby C0rby added the Status:Needs-Review Needs review from a maintainer label Oct 12, 2021
@wkloucek
Copy link
Contributor

@C0rby this needs a rebase, CI was fixed in 90246d7

@C0rby C0rby force-pushed the create-space-response branch from 71dd8ed to c4d4efd Compare October 12, 2021 17:20
@ownclouders
Copy link
Contributor

💥 Acceptance tests Core-API-Tests-ocis-storage-4 failed. The build is cancelled...

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@C0rby C0rby merged commit ff74784 into master Oct 12, 2021
ownclouders pushed a commit that referenced this pull request Oct 12, 2021
Merge: 185e11e c4d4efd
Author: David Christofas <dchristofas@owncloud.com>
Date:   Tue Oct 12 20:33:32 2021 +0200

    Merge pull request #2610 from owncloud/create-space-response

    return newly created space in response
@refs
Copy link
Member

refs commented Oct 12, 2021

👍 as per the docs:

Upon successful completion the service MUST respond with either 201 Created and a representation of the created entity, or 204 No Content

sauce

I think we should aim to be OData compatible, and not use the ms docs as reference? Thoughts @C0rby @butonic

I messaged the maintainer of OData regarding taking over maintenance of the library and await for a response :)

@C0rby C0rby deleted the create-space-response branch October 13, 2021 07:17
@C0rby
Copy link
Contributor Author

C0rby commented Oct 13, 2021

+1 as per the docs:

> > Upon successful completion the service MUST respond with either 201 Created and a representation of the created entity, or 204 No Content

sauce

I think we should aim to be OData compatible, and not use the ms docs as reference? Thoughts @C0rby @butonic

Oh there is more to that sentence:

204 No Content if the request included a Prefer header with a value of return=minimal and did not include the system query options $select and $expand.

So if we want to support the full functionality, we need to add some more logic.

@refs
Copy link
Member

refs commented Oct 13, 2021

exactly, this is why I brought this up there is more to MSGraph than just their implementation. On the one hand we should focus on OData, but on the other hand we use the msgraph client so it is tied to their implementation of OData, which is pretty flexible. If we use the graph explorer to test the graph API then we are marrying with MSGraph, not OData.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status:Needs-Review Needs review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants