txlog-api bugs
TxLog API behaviour is not aligned with the OAS specification.
- records is mandatory according to the OAS but not in de actual API (see example below)
- OAS specifies
/v1/logs
as path (basepath combined with path), actual API uses/logs
(nov1
)
reproduce bug on local development environment:
curl -v -X 'POST' \
--key pki/internal/organization-a/certs/inway/key.pem \
--cert pki/internal/organization-a/certs/inway/cert.pem \
--cacert pki/internal/organization-a/ca/root.pem \
'https://txlog-api.organization-a.nlx.local:7611/logs' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{"transaction_id":"018dd166-64b3-7b1f-921b-036f0236abfa","group_id":"fsc-local","direction":"DIRECTION_INCOMING","grant_hash":"$1$3$PLbYUqhoxclJqBTTKdUksZvBqHJ8k1iRqiFB3xzJY_tqyIqJHiLgxzRW_aU70UBEYba2GXWHJ2xvuRNus_3_IA","source":{"type":"SOURCE_TYPE_SOURCE","outway_peer_id":"12345678901234567892","delegator_peer_id":null},"destination":{"type":"DESTINATION_TYPE_DESTINATION","service_peer_id":"12345678901234567890","delegator_peer_id":null},"created_at":1708615173,"service_name":"hello"}'
this returns 204
but no records have been created:
curl -X 'GET' \
--key pki/internal/organization-a/certs/inway/key.pem \
--cert pki/internal/organization-a/certs/inway/cert.pem \
--cacert pki/internal/organization-a/ca/root.pem \
'https://txlog-api.organization-a.nlx.local:7611/logs?group_id=fsc-local' \
-H 'accept: application/json'
{"pagination":{"next_cursor":""},"records":[]}
expected behaviour is a 422
response of the POST
method.
Edited by Pim Gaemers