diff --git a/docs/credentials-with-issuer-dependent-terms.json b/docs/credentials-with-issuer-dependent-terms.json index f1fbbb526..f8914a4e6 100644 --- a/docs/credentials-with-issuer-dependent-terms.json +++ b/docs/credentials-with-issuer-dependent-terms.json @@ -15,6 +15,10 @@ "type": "USMCACertificationOfOrigin", "count": 0 }, + { + "type": "ThingCredential", + "count": 0 + }, { "type": "SoftwareBillofMaterialsCredential", "count": 200 diff --git a/docs/openapi/components/schemas/common/Thing.yml b/docs/openapi/components/schemas/common/Thing.yml new file mode 100644 index 000000000..33b7a0e2c --- /dev/null +++ b/docs/openapi/components/schemas/common/Thing.yml @@ -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" + } \ No newline at end of file diff --git a/docs/openapi/components/schemas/credentials/ThingCredential.yml b/docs/openapi/components/schemas/credentials/ThingCredential.yml new file mode 100644 index 000000000..7875e50a5 --- /dev/null +++ b/docs/openapi/components/schemas/credentials/ThingCredential.yml @@ -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" + } + } \ No newline at end of file diff --git a/docs/openapi/openapi.yml b/docs/openapi/openapi.yml index b34209470..e0d14e312 100644 --- a/docs/openapi/openapi.yml +++ b/docs/openapi/openapi.yml @@ -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: @@ -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: