dc4eu / vc

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

Problem with apiv1.GetDocumentCollectIDReply #61

Open fabienpe opened 2 months ago

fabienpe commented 2 months ago

On version: 25298ad1941b83f0affea70d43a976c2744b404f

apiv1.GetDocumentCollectIDReply is defined as "$ref": "#/definitions/model.Upload", which itself contains a meta property defined in "$ref": "#/definitions/model.MetaData". Butmodel.MetaDatarequiresdate_of_birth,first_nameandlast_name` which are not provided in the actual response.

In other words, while the announced output is:

{
  "data": {
    "attestation": {
      "description_long": "string",
      "description_short": "string",
      "description_structured": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "type": "string",
      "version": "string"
    },
    "document_data": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    },
    "identity": {
      "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",
      "version": "string"
    },
    "meta": {
      "authentic_source": "string",
      "authentic_source_person_id": "string",
      "collect_id": "string",
      "created_at": 0,
      "date_of_birth": "string",
      "document_id": "string",
      "document_type": "PDA1",
      "document_version": "string",
      "first_name": "string",
      "last_name": "string",
      "member_state": "string",
      "revocation": {
        "follow_up_credential": "string",
        "id": "string",
        "reason": "string",
        "revoked": true,
        "revoked_at": 0
      },
      "valid_from": 0,
      "valid_to": 0
    },
    "qr": {
      "base64_image": "string",
      "deep_link": "string"
    }
  }
}

I just get:

{
    "data": {
        "meta": {
            "authentic_source": "string",
            "authentic_source_person_id": "string",
            "document_version": "string",
            "document_type": "PDA1",
            "document_id": "string",
            "collect_id": "string",
            "member_state": "string",
            "valid_from": int,
            "valid_to": int
        },
        "document_data": {
            "string": "string"
        }
    }
}
masv3971 commented 1 month ago

The output is defined in api 2.4 documentation provided from Thomas. The rational of this is to minimize the amount of types with in the code base. If each endpoint had to have its own (complex) type, changes will be harder to achieve.

fabienpe commented 1 month ago

OK. That's a pity because if you use a tool such as https://github.com/OpenAPITools/openapi-generator to convert the JSON provided by the Swagger of the DC4EU API, to generate client code, then it only partly works because the behaviour of the API does not exactly match the JSON.

masv3971 commented 1 month ago

I have come to understand that, this needs to be addressed for sure. Many is using some generator to generate client code. Will fix this.