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

414 problem details response #418

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions components/ProblemDetail.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
openapi: 3.0.0
info:
version: "0.0.3-unstable"
title: VC API
description: This is an Experimental Open API Specification for the [VC Data Model](https://www.w3.org/TR/vc-data-model/).
license:
name: W3C Software and Document License
url: http://www.w3.org/Consortium/Legal/copyright-software.
contact:
name: GitHub Source Code
url: https://github.com/w3c-ccg/vc-api
paths:
components:
schemas:
ProblemDetails:
type:
type: string
description: URL identifying the type of problem.
code:
type: integer
description: Integer that identifies the type of the problem.
title:
type: string
description: Short but specific human-readable string for the problem.
detail:
type: string
description: Longer human-readable string for the problem.
example: {
"type": "https://www.w3.org/TR/vc-data-model#PARSING_ERROR",
"code": -64,
"title": "PARSING_ERROR",
"detail": "There was an error while parsing input.",
}
10 changes: 9 additions & 1 deletion components/VerifyCredentialOptions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ components:
additionalProperties: false
description: Options for specifying how a credential is verified
properties:
returnResults:
type: boolean
description: Include results for each verification steps taken in the response, such as verifying individual proofs, statuses and schemas.
returnProblemDetails:
type: boolean
description: Include ProblemDetails errors and warnings in the response.
returnCredential:
type: boolean
description: Should the verified credential be returned in the response? If true, then the verified credential should be returned in the form in which it was verified. If false or not provided, then the verified credential should not be returned.
example:
{
"returnCredential": true
"returnProblemDetails": true,
"returnCredential": true,
"returnResults": true
}
77 changes: 66 additions & 11 deletions components/VerifyCredentialResult.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,77 @@ components:
additionalProperties: false
description: Object summarizing a verification
properties:
checks:
type: array
description: The checks performed
items:
type: string
verified:
type: boolean
description: Overall verification assertion of the payload. This is set to True if no errors were detected during the verification process, otherwise False. See error handling section for more guidance around errors, warnings, validation and verification.
results:
type: object
additionalProperties: false
description: Verification results to be included as a more verbose output.
properties:
validityPeriod:
type: object
description: Results from validating the validFrom and validUntil values if present in the VerifiableCredential.
properties:
valid:
type: boolean
description: Results from validating the validFrom and validUntil values.
validFrom:
type: string
description: The validFrom value.
validUntil:
type: string
description: The validUntil value.
credentialSchema:
type: array
description: Results from validating the credentialSchema objects if any.
items:
type: object
description: Results from validating a credentialSchema object.
properties:
valid:
type: boolean
description: Results from validating the credentialSchema object.
PatStLouis marked this conversation as resolved.
Show resolved Hide resolved
input:
type: object
description: The credentialSchema object.
credentialStatus:
type: array
description: Results from validating the credentialStatus objects if any.
items:
type: object
description: Results from validating a credentialStatus object.
PatStLouis marked this conversation as resolved.
Show resolved Hide resolved
properties:
valid:
type: boolean
description: Results from validating the credentialStatus object.
PatStLouis marked this conversation as resolved.
Show resolved Hide resolved
input:
type: object
description: The credentialStatus object.
proof:
type: array
description: Results from validating the proof objects if any.
items:
type: object
description: Results from validating a proof object.
properties:
valid:
type: boolean
description: Results from validating the proof object.
PatStLouis marked this conversation as resolved.
Show resolved Hide resolved
input:
type: object
description: The proof object.
warnings:
type: array
description: Warnings
description: Array consisting of ProblemDetails warning objects.
items:
type: string
type: object
errors:
type: array
description: Errors
description: Array consisting of ProblemDetails error objects.
items:
type: string
type: object
credential:
type: object
description: The verified credential
example: { "checks": ["proof"], "warnings": [], "errors": [] }
description: The verified credential used as the verification payload.
example: { "verified": True, "results": {"credentialSchema": [], "credentialStatus": [], "proof": []}, "warnings": [], "errors": [] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
example: { "verified": True, "results": {"credentialSchema": [], "credentialStatus": [], "proof": []}, "warnings": [], "errors": [] }
example: { "verified": true, "results": {"credentialSchema": [], "credentialStatus": [], "proof": []}, "warnings": [], "errors": [] }