-
Notifications
You must be signed in to change notification settings - Fork 5
Make API compositional and use style guide naming convention. #43
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.
This appears to be in line with the style guide where HTTP Methods are preferred over defining specific endpoints that would achieve the same.
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 pretty much disagree with both changes in this PR, which should probably be broken up into two separate PRs.
- It makes no sense to me to have an issuing API that only composes but doesn't sign a credential. When would you use that? This should be a single operation, as it was in v0.0.1.
- I agree with the naming convention, but with this PR the naming convention is applied to only one of the endpoints. Both endpoints are for issuing a credential. It's inconsistent style to name one
/credentials
and the other one/credentials/compose
. Either use nouns in both cases, or verbs in both cases.
Also, we have no experience yet whether passing in a fully constructed credential to the API (new endpoint added in v0.0.2) or letting the API construct a credential (original endpoint in v0.0.1) will be the more common case. Until we learn more about that, we shouldn't name the endpoints in a way that gives the impression that one is preferred or more important than the other.
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’m also concerned with the idea of "already composed" mode is being at the root of /credentials path while "compose" is in a subpath. I do like shortening the names (e.g., /credentials/compose
is an improvement).
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.
Instead of continuing to debate on this PR, I suggest we close this, and address the API style guide first... we appear to have some pretty fundamental disagreements regarding design, which need to be addressed first.
The reason for this is to follow restful naming convention per the proposed style guide. The
You'd use it to compose the credential right before you submit it to the |
@dlongley I see. I didn't understand from the API description that you were constructing the flow this way.
|
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.
dismissing my review.
So if I understand the proposal from @dlongley properly:
Due to this last assumption in the proposal, |
That's right. Nothing is stored on the server without it also having been issued and there's no option to only issue a credential without storing a reference to it. If you want or need to use another service to compose the credential via a template/other options before submitting it to be issued, the |
@dlongley Ok that makes sense under those assumptions. Are there alternative situations where:
(those scenarios could impact the consistency of a combined issue + store operation on |
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.
Noted the atomicity of issuance and credential reference discussion in https://github.com/w3c-ccg/vc-issuer-http-api/issues/45
I don't like the direction this PR takes. Composability should be carefully weighed against performance with these network calls. The overall picture isn't clear to me yet, but I'm on the same boat as @peacekeeper for now - I don't see the usefulness of this particular decomposition ("issuance" + "saving"). And there will be functional overlaps (like "linting"). |
I'm in favor of closing this PR, getting better alignment on the API style guide and merging the specs so we don't have as many places to look, split focus on these API design issues. |
@@ -68,16 +68,16 @@ paths: | |||
content: | |||
application/json: | |||
schema: | |||
$ref: '#/components/schemas/ComposeAndIssueCredentialRequest' | |||
description: Parameters for issuing the credential. | |||
$ref: '#/components/schemas/ComposeCredentialRequest' |
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.
Would've needed to rename the schema type btw.
This is on hold until after some interop has occurred on the current version. This can be picked up later as more is learned from implementation experience on the current version. |
I suggest closing this PR, and waiting till we are in 1 repo before attempting any further changes. |
I am closing this PR, we need to merge the specs. |
This PR changes the name for the issuing endpoint and the compose endpoint to fall in line with the proposed style guide naming conventions. It also changes the compose API to only compose a credential -- the output of which can then be sent to the issue API. IMO, this gives us a cleaner separation of concerns and better composition API/reuse.