Skip to content

Commit

Permalink
Merge pull request #769 from Mavennet/feat/addExternalIdentifier
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhraisha authored May 12, 2023
2 parents a668edb + 91e7c8d commit 53597d1
Show file tree
Hide file tree
Showing 4 changed files with 180 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/credentials-with-issuer-dependent-terms.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"type": "USMCACertificationOfOrigin",
"count": 0
},
{
"type": "ThingCredential",
"count": 0
},
{
"type": "SoftwareBillofMaterialsCredential",
"count": 200
Expand Down
42 changes: 42 additions & 0 deletions docs/openapi/components/schemas/common/Thing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
$linkedData:
term: Thing
'@id': https://schema.org/Thing
title: Thing
description: The most generic type of item.
type: object
properties:
type:
type: array
readOnly: true
const:
- Thing
default:
- Thing
items:
type: string
enum:
- Thing
identifier:
description: The identifier property represents any kind of identifier for any kind of Thing, such as ISBNs, GTIN codes, UUIDs, etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See background notes for more details.
type: string
$linkedData:
term: uri
'@id': https://schema.org/identifier
name:
title: Name
description: The name of the item.
type: string
$linkedData:
term: uri
'@id': https://schema.org/name
additionalProperties: true
required:
- type
example: |-
{
"type": [
"Thing"
],
"identifier": "123",
"name": "entrySummaryId"
}
110 changes: 110 additions & 0 deletions docs/openapi/components/schemas/credentials/ThingCredential.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
$linkedData:
term: ThingCredential
'@id': https://w3id.org/traceability#ThingCredential
title: Thing Credential
tags:
- Steel
- eCommerce
- Agriculture
- Oil and Gas
- Other
description: A credential that contains a thing.
type: object
properties:
'@context':
type: array
readOnly: true
const:
- https://www.w3.org/2018/credentials/v1
- https://w3id.org/traceability/v1
default:
- https://www.w3.org/2018/credentials/v1
- https://w3id.org/traceability/v1
items:
type: string
enum:
- https://www.w3.org/2018/credentials/v1
- https://w3id.org/traceability/v1
type:
type: array
readOnly: true
const:
- VerifiableCredential
- ThingCredential
default:
- VerifiableCredential
- ThingCredential
items:
type: string
enum:
- VerifiableCredential
- ThingCredential
id:
type: string
name:
type: string
description:
type: string
issuanceDate:
type: string
expirationDate:
type: string
issuer:
$ref: ../common/Organization.yml
credentialSchema:
type: object
properties:
id:
title: Id
description: The url of the schema file to validate the shape of the json object
type: string
format: uri
example: https://w3id.org/traceability/openapi/components/schemas/credentials/ThingCredential.yml
type:
title: Type
description: The type of validation to be run against the defined schema
const: OpenApiSpecificationValidator2022
credentialSubject:
$ref: ../common/Thing.yml
proof:
$ref: ../snippets/proof.yml
additionalProperties: false
required:
- '@context'
- type
- issuanceDate
- issuer
- credentialSubject
example: |-
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/traceability/v1"
],
"id": "http://example.com/dd0c6f9a-5df6-40a3-bb34-863cd1fda606",
"type": [
"VerifiableCredential",
"ThingCredential"
],
"issuer": {
"type": [
"Organization"
],
"id": "did:key:z6MktHQo3fRRohk44dsbE76CuiTpBmyMWq2VVjvV6aBSeE3U"
},
"issuanceDate": "2022-11-01T10:58:45-04:00",
"credentialSubject": {
"type": [
"Thing"
],
"identifier": "123",
"name": "entrySummaryId"
},
"proof": {
"type": "Ed25519Signature2018",
"created": "2023-05-11T18:15:29Z",
"verificationMethod": "did:key:z6MktHQo3fRRohk44dsbE76CuiTpBmyMWq2VVjvV6aBSeE3U#z6MktHQo3fRRohk44dsbE76CuiTpBmyMWq2VVjvV6aBSeE3U",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..-XauuCyKOfCH9RTOc3B8003PQI_oAHwb9UCr26L7COA5kDLdnXzFmgKpiy6v4xd39j-kCbRqlAmTl_fO-4ZYBw"
}
}
24 changes: 24 additions & 0 deletions docs/openapi/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1796,6 +1796,18 @@ paths:
$ref: './components/schemas/common/Template.yml'


/schemas/common/Thing.yml:
get:
tags:
- common
responses:
'200':
content:
application/yml:
schema:
$ref: './components/schemas/common/Thing.yml'


/schemas/common/TraceabilityAPI.yml:
get:
tags:
Expand Down Expand Up @@ -2792,6 +2804,18 @@ paths:
$ref: './components/schemas/credentials/SoftwareBillofMaterialsCredential.yml'


/schemas/credentials/ThingCredential.yml:
get:
tags:
- credentials
responses:
'200':
content:
application/yml:
schema:
$ref: './components/schemas/credentials/ThingCredential.yml'


/schemas/credentials/USMCACertificationOfOrigin.yml:
get:
tags:
Expand Down

0 comments on commit 53597d1

Please sign in to comment.