Open
Description
There seem to be quite a few errors so I won't go into much detail. However, I noticed that if I take the schema above and the example json (copy pasted from /credentials/issue
endpoint in that url) using the curl command I get the following error.
daidoji@worklaptop:~/TrustScience/vc-http-api/pcurl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST --data @bar.json http://localhost:8080/credentials/issue
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json; charset=utf-8
Content-Length: 109
Date: Tue, 02 Mar 2021 22:27:06 GMT
Server: Python/3.9 aiohttp/3.6.3
{"detail": [{"loc": ["body", "credential", "issuer"], "message": "'did:example:123' is not of type object"}]}
However, you'll see in the yaml that body/credential/issuer can be:
Issuer:
type: object
description: A JSON-LD Verifiable Credential Issuer.
oneOf:
- type: string
- type: object
properties:
id:
type: string
example:
{ "id": "did:key:z6MkjRagNiMu91DduvCvgEsqLZDVzrJzFrwahc4tXLt9DoHd" }
So I should be able to pass an json object
of type object
with a property of id
or a string
directly. This seems like a bug in rororo because if I remove the oneOf
section and chance the type
of the Issuer
spec to string
directly then the curl command works.