maykinmedia / open-klant

Registratiecomponent voor de opslag en ontsluiting van klantgegevens volgens de Klantinteracties API-specificatie.
Other
2 stars 3 forks source link

Cannot use all expand options with partijen endpoint generated by OpenAPI #216

Open hsiliev opened 3 months ago

hsiliev commented 3 months ago

Product versie / Product version

2.1

Omschrijf het probleem / Describe the bug

Recomended approach to fetch kontact with BSN in https://github.com/maykinmedia/open-klant/issues/138 does not seem to work as intended with generated OpenAPI models and client as ExpandPartijAllOfExpand class uses List<Betrokkene> that does not have expanded hadKlantcontact but only foreign keys.

Stappen om te reproduceren / Steps to reproduce

  1. Generate Java OpenAPI models and client
  2. Fix issues with wrong assignments of List in Partij and ExpandPartij
  3. Request Partij with nummer and expand "betrokkenen, betrokkenen.hadKlantcontact"
  4. The response does not contain expanded klantcontact

Verwacht gedrag / Expected behavior

ExpandBetrokkenen* is instead documented and used in ExpandPartijAllOfExpand

joeribekker commented 3 months ago

Karin (Dimpact) needs to find budget for this. If this is an issue with the client generation tools, then we're not going to fix it. If it's an issue in the API spec, we can fix it if budget allows it.

joeribekker commented 1 month ago

@hsiliev can you provide a request and response example that shows your issue?

hsiliev commented 1 month ago

The problem we have is that the client that's generated requires manual changes to work out of the box. Request-response data is ok.

The generated client using OpenAPI definition 2.3 has in ExpandPartijAllOfExpand has:

  /**
   * Betrokkene bij klantcontact die een partij was.
   * @return betrokkenen
   **/
  public List<Betrokkene> getBetrokkenen() {
    return betrokkenen;
  }

Therefore although the response contains the correct expanded data, the client cannot deserialize it.