VNG-Realisatie / gemma-zaken

Samen ontwikkelen van API's voor Zaakgericht werken
https://vng-realisatie.github.io/gemma-zaken/
Other
41 stars 26 forks source link

Lock attribuut ontbreekt nog steeds bij bestandsdelen (1.4.2) #2360

Closed rderooij closed 8 months ago

rderooij commented 9 months ago

Ticket https://github.com/VNG-Realisatie/gemma-zaken/issues/2336#issuecomment-1753082053 zou nu opgelost moeten zijn in versie 1.4.2: https://github.com/VNG-Realisatie/gemma-zaken/milestone/34.

Ik heb getest met documenten-api:1.4.2 en de response geeft nog niet het gewenste resultaat. Er is nog steeds geen lock attribuut aanwezig in bestandsdelen. Versie 1.3.2 kan ik niet testen omdat deze niet beschikbaar is.

Request method: POST
Request URI:    http://drc.local:8000/api/v1/enkelvoudiginformatieobjecten
Proxy:                  <none>
Request params: <none>
Query params:   <none>
Form params:    <none>
Path params:    <none>
Headers:                Accept=application/json, application/javascript, text/javascript, text/json
                                Authorization=Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkcmNfYXBpX3Rlc3RzIiwiZXhwIjoxNjk2OTM0ODgzLCJpYXQiOjE2OTY5MzEyODMsImNsaWVudF9pZCI6ImRyY19hcGlfdGVzdHMifQ.yRqcNjLItDFBFqBkB1kLjQDYEAsIRF_5t_YIzdhk3A0
                                Content-Type=application/json; charset=UTF-8
Cookies:                <none>
Multiparts:             <none>
Body:
{
    "beschrijving": "test_beschrijving",
    "identificatie": "b39deafe-4d7d-4a87-8576-6bea94468b36",
    "bronorganisatie": "159351741",
    "bestandsomvang": 21,
    "link": "http://een.link",
    "taal": "eng",
    "auteur": "test_auteur",
    "formaat": "txt",
    "inhoud": "",
    "titel": "detailed summary",
    "vertrouwelijkheidaanduiding": "openbaar",
    "informatieobjecttype": "http://open-zaak.local:8000/catalogi/api/v1/informatieobjecttypen/9409be5a-9806-473c-8900-bd8af2a6f920",
    "bestandsnaam": "dummy.txt",
    "creatiedatum": "2018-06-27"
}
HTTP/1.1 201 Created
Content-Type: application/json
Location: http://drc.local:8000/api/v1/enkelvoudiginformatieobjecten/215da4da-113c-4f3f-8837-30b311c10fb8
Allow: GET, POST, HEAD, OPTIONS
API-version: 1.4.2
X-Frame-Options: DENY
Content-Length: 1149
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin

{
    "url": "http://drc.local:8000/api/v1/enkelvoudiginformatieobjecten/215da4da-113c-4f3f-8837-30b311c10fb8",
    "identificatie": "b39deafe-4d7d-4a87-8576-6bea94468b36",
    "bronorganisatie": "159351741",
    "creatiedatum": "2018-06-27",
    "titel": "detailed summary",
    "vertrouwelijkheidaanduiding": "openbaar",
    "auteur": "test_auteur",
    "status": "",
    "formaat": "txt",
    "taal": "eng",
    "versie": 1,
    "beginRegistratie": "2023-10-10T09:48:05.081313Z",
    "bestandsnaam": "dummy.txt",
    "inhoud": null,
    "bestandsomvang": 21,
    "link": "http://een.link",
    "beschrijving": "test_beschrijving",
    "ontvangstdatum": null,
    "verzenddatum": null,
    "indicatieGebruiksrecht": null,
    "verschijningsvorm": "",
    "ondertekening": {
        "soort": "",
        "datum": null
    },
    "integriteit": {
        "algoritme": "",
        "waarde": "",
        "datum": null
    },
    "informatieobjecttype": "http://open-zaak.local:8000/catalogi/api/v1/informatieobjecttypen/9409be5a-9806-473c-8900-bd8af2a6f920",
    "locked": true,
    "bestandsdelen": [
        {
            "url": "http://drc.local:8000/api/v1/bestandsdelen/da9459d9-130d-4f34-8455-27e433d7b822",
            "volgnummer": 1,
            "omvang": 21,
            "voltooid": false
        }
    ],
    "trefwoorden": null,
    "lock": "29e4fcfa82134ceaab565e0815414a86"
}
Request method: GET
Request URI:    http://drc.local:8000/api/v1/enkelvoudiginformatieobjecten/215da4da-113c-4f3f-8837-30b311c10fb8
Proxy:                  <none>
Request params: <none>
Query params:   <none>
Form params:    <none>
Path params:    <none>
Headers:                Accept=application/json, application/javascript, text/javascript, text/json
                                Authorization=Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkcmNfYXBpX3Rlc3RzIiwiZXhwIjoxNjk2OTM0ODg1LCJpYXQiOjE2OTY5MzEyODUsImNsaWVudF9pZCI6ImRyY19hcGlfdGVzdHMifQ.lFeWmMxKVptPVPkuAuldwn1b0IHSsH7jOWp6iG4E3po
                                Content-Type=application/json; charset=UTF-8
Cookies:                <none>
Multiparts:             <none>
Body:                   <none>
HTTP/1.1 200 OK
Content-Type: application/json
ETag: "5968337ada690316b9a90110b562cac7"
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
API-version: 1.4.2
X-Frame-Options: DENY
Content-Length: 1105
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin

{
    "url": "http://drc.local:8000/api/v1/enkelvoudiginformatieobjecten/215da4da-113c-4f3f-8837-30b311c10fb8",
    "identificatie": "b39deafe-4d7d-4a87-8576-6bea94468b36",
    "bronorganisatie": "159351741",
    "creatiedatum": "2018-06-27",
    "titel": "detailed summary",
    "vertrouwelijkheidaanduiding": "openbaar",
    "auteur": "test_auteur",
    "status": "",
    "formaat": "txt",
    "taal": "eng",
    "versie": 1,
    "beginRegistratie": "2023-10-10T09:48:05.081313Z",
    "bestandsnaam": "dummy.txt",
    "inhoud": null,
    "bestandsomvang": 21,
    "link": "http://een.link",
    "beschrijving": "test_beschrijving",
    "ontvangstdatum": null,
    "verzenddatum": null,
    "indicatieGebruiksrecht": null,
    "verschijningsvorm": "",
    "ondertekening": {
        "soort": "",
        "datum": null
    },
    "integriteit": {
        "algoritme": "",
        "waarde": "",
        "datum": null
    },
    "informatieobjecttype": "http://open-zaak.local:8000/catalogi/api/v1/informatieobjecttypen/9409be5a-9806-473c-8900-bd8af2a6f920",
    "locked": true,
    "bestandsdelen": [
        {
            "url": "http://drc.local:8000/api/v1/bestandsdelen/da9459d9-130d-4f34-8455-27e433d7b822",
            "volgnummer": 1,
            "omvang": 21,
            "voltooid": false
        }
    ],
    "trefwoorden": null
}
michielverhoef commented 9 months ago

https://vng-realisatie.github.io/gemma-zaken/standaard/documenten/redoc-1.4.2#tag/enkelvoudiginformatieobjecten/operation/enkelvoudiginformatieobject_retrieve

In de standaard is het attribuut lock opgenomen in het groepsattribuut bestandsdelen

In de OAS van de referentieimplementatie is dit ook opgenomen: https://redocly.github.io/redoc/?nocors&url=https://raw.githubusercontent.com/VNG-Realisatie/documenten-api/develop/src/openapi.yaml#tag/enkelvoudiginformatieobjecten/operation/enkelvoudiginformatieobject_retrieve

https://documenten-api.vng.cloud/api/v1/schema/#tag/enkelvoudiginformatieobjecten/operation/enkelvoudiginformatieobject_retrieve

Ik ben nog aan het testen maar zou je zelf ook eens op de hosted version kunnen testen? http://documenten-api.vng.cloud/api/v1/enkelvoudiginformatieobjecten

Want aan jouw bericht te zien draai je lokaal een versie en die kan ik niet testen/controleren.

rderooij commented 9 months ago

Ik heb geen toegang tot de hosted versie.

michielverhoef commented 9 months ago

De hosted versie is volledig publiek toegankelijk. Een bearer token aanmaken en in de hosted versie seeden staat beschreven in de README van https://github.com/VNG-Realisatie/token-issuer . Als het niet lukt: herhaal de stappen nog een keer, soms hapert er wat.

Dan kun je daarna je calls doen naar https://documenten-api.vng.cloud/

rderooij commented 8 months ago

Ik heb opnieuw mijn unit tests uitgevoerd maar krijg hetzelfde resultaat. Er is niks aangepast ten opzichte van versie 1.4.1 m.b.t. bestandsdelen.

Ik heb nog even vergeleken met de hosted versie, maar ik gebruik lokaal dezelfde versie: ghcr.io/vng-realisatie/documenten-api:1.4.2.

michielverhoef commented 8 months ago

Ik het zojuist ook getest en inderdaad, de referentie implementatie geeft de lock niet terug. Dat is een bug in de referentie implementatie. In de standaard staat dit wel netjes beschreven.

De termijn waarop het gaat lukken om dit op te lossen is nog niet bekend maar ik ga mijn best doen dit zo snel mogelijk opgelost te krijgen.

shazada commented 8 months ago

@michielverhoef Wellicht goed om de achterliggende gedachte te schetsen --> we gebruiken de referentie-implementatie om onze geautomatiseerde unit-tests te runnen. Dus het is vanuit ontwikkeling eigenlijk niet te doen om handmatig a.d.h.v. tekst of een yaml dingen wel of niet te valideren.

om een inhoudelijke voorbeeld te geven:

  1. docker run referentie-impl:
  2. docker run tezza-drc:
  3. docker run unit-tests:latest

Dit geeft dan een rapport wat het verschil is tussen onze DRC en de ref-implementatie en dat fixen we dan in de code en dan runnen we de tests opnieuw.

michielverhoef commented 8 months ago

Deze bug is vandaag opgelost in release 1.4.3: https://documenten-api.vng.cloud/api/v1/schema/#tag/enkelvoudiginformatieobjecten/operation/enkelvoudiginformatieobject_create NB. De documentatie moet nog worden bijgewerkt maar is niet aangepast ten opzichte van Documenten API 1.4.2. Dit is slechts een fix in de referentie implementatie geweest.