-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add POST endpoint for additional access methods to existing object #47
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, it's a very good start :) I have suggested some changes, mostly small.
@@ -110,6 +110,47 @@ paths: | |||
tags: | |||
- DRS-Filer | |||
x-swagger-router-controller: ga4gh.drs.server | |||
'/objects/{object_id}/access': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As briefly discussed, I'm afraid we will need to create a different endpoint here, maybe /objects/{object_id}/access:register
, because in the latest versions of the DRS specification, there is (unfortunately) already a POST
method defined for /objects/{object_id}/access
that has a different non-REST-compliant meaning (see here).
Actually, supporting the new DRS versions will require a lot of code changes on DRS-Filer, including some breaking changes, but for now let's just focus on this issue and try to avoid conflicts in the future, when we will do the migration to the latest version.
operationId: PostObjectAccess | ||
responses: | ||
'201': | ||
description: Successfully added access method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To keep in the style of the other descriptions, maybe better to write:
The access method was successfully added.
@@ -110,6 +110,47 @@ paths: | |||
tags: | |||
- DRS-Filer | |||
x-swagger-router-controller: ga4gh.drs.server | |||
'/objects/{object_id}/access': | |||
post: | |||
summary: Add additional access method to an existing object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an additional access method to an existing object
'/objects/{object_id}/access': | ||
post: | ||
summary: Add additional access method to an existing object. | ||
operationId: PostObjectAccess |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the same reason as above, maybe it's better to write PostObjectAccessRegister
here.
'409': | ||
description: Conflict - Object with the same ID already exists. | ||
schema: | ||
$ref: '#/definitions/Error' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that in a POST
request the resource ID will generally be created by the implementation, it is the implementation's responsibility to ensure that this type of error does not happen. So you can remove it from the specs.
method_id: | ||
type: string | ||
description: ID of the access method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be created by the implementation/service, so no need to put it here.
@@ -501,3 +542,20 @@ definitions: | |||
- name | |||
tags: | |||
- name: DataRepositoryService | |||
AdditionalAccessMethod: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just reuse the AccessMethodRegister
model/component that is already defined in this file. No need to create a new one.
name: AdditionalAccessMethod | ||
description: Additional access method details. | ||
schema: | ||
$ref: '#/definitions/AdditionalAccessMethod' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use AccessMethodRegister
, see below.
Description
Added a new endpoint to allow posting additional access methods to an existing DRS object.
Fixes #25
Type of change
New feature
Please delete options that are not relevant.
Checklist: