dc4eu / vc

European Wallet
BSD 2-Clause "Simplified" License
0 stars 2 forks source link

Problem with apiv1.GetDocumentReply #40

Open fabienpe opened 4 months ago

fabienpe commented 4 months ago

If I understand correctly the information provided in Swagger, when requesting a document with the /api/v1/document, the response is expected to be of the form (according to the : /swagger/doc.json)

{
"apiv1.GetDocumentReply": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/model.Upload"
                }
            }
        }

and therefore something like:

{
  "data": {
    "attestation": {
      "description_long": "string",
      "description_short": "string",
      "type": "string",
      "version": 0
    },
    "document_data": "string",
    "identity": {
      "age_birth_year": "string",
      "age_in_years": "string",
      "age_over_18": "string",
      "age_over_nn": "string",
      "birth_city": "string",
      "birth_country": "string",
      "birth_date": "string",
      "birth_place": "string",
      "birth_state": "string",
      "family_name": "string",
      "family_name_at_birth": "string",
      "gender": "string",
      "given_name": "string",
      "given_name_at_birth": "string",
      "nationality": "string",
      "resident_address": "string",
      "resident_city": "string",
      "resident_country": "string",
      "resident_house_number": "string",
      "resident_postal_code": "string",
      "resident_state": "string",
      "resident_street": "string",
      "uid": "string",
      "version": "string"
    },
    "meta": {
      "authentic_source": "string",
      "authentic_source_person_id": "string",
      "collect_id": "string",
      "created_at": "string",
      "date_of_birth": "string",
      "document_id": "string",
      "document_type": "PDA1",
      "document_version": 1,
      "first_name": "string",
      "last_name": "string",
      "member_state": "string",
      "revocation_id": "string",
      "uid": "string",
      "valid_from": "string",
      "valid_to": "string"
    },
    "qr": {
      "base64_image": "string",
      "deep_link": "string"
    }
  }
}

However I get something of the form:

{
  "data": {
    "meta": {
      "revocation_id": "string",
      "collect_id": "string",
      "created_at": "date"
    },
    "document_data": null,
    "qr": null
  }
}
masv3971 commented 4 months ago

Thank you for reaching out, #39 is meant to solve this.

fabienpe commented 4 months ago

FYI - I'm using

commit 1f7e8d89ca254186134e8b1bea86ad5967004c18 (HEAD -> main, origin/main, origin/HEAD)
Author: masv3971 <masv@sunet.se>
Date:   Wed Apr 3 14:56:40 2024 +0200

    Add documentation about swagger.