credentials_dev_public's People
credentials_dev_public's Issues
[API] DELETE endpoints respond differently
The Issue I encountered
When deleting resources I expect the same/similar responses from the API.
- Deleting an existing
person
results currently in a 200 response with a JSON body. - Deleting an non existing
person
results currently in a 404 response with a JSON body. - Deleting an existing
document
results currently in a 200 response with a text body. - Deleting an non existing
document
results currently in a 200 response with a text body.
I would expect a 204 No Content for a successful deletion and a 404 Not Found, maybe with further details in a JSON body, as a response.
In case 200 OK is the desired status for this project, the response should, in IMHO, be always a JSON in the same schema.
How to reproduce the description above
Delete a person by id /v1/delete_person
Resource exists
Call
curl -X 'DELETE' \
'https://sandbox.api.credentials.dev/v1/people/34a36028-dddc-477f-9676-ceb75089658a/' \
-H 'accept: application/json' \
-H 'X-API-Key: REDACTED'
Response
Code: 200
Body:
{
"deleted": true
}
Resource doesn't exists (anymore)
Call
curl -X 'DELETE' \
'https://sandbox.api.credentials.dev/v1/people/34a36028-dddc-477f-9676-ceb75089658a/' \
-H 'accept: application/json' \
-H 'X-API-Key: REDACTED'
Response
Code: 404
Body:
{
"detail": "Could not find this person for this tenant."
}
Delete a document by id /v1/people/{person_id}/documents/{document_id}/
Resource exists
Call
curl -X 'DELETE' \
'https://sandbox.api.credentials.dev/v1/people/34a36028-dddc-477f-9676-ceb75089658a/documents/c2141f12-8d69-47d1-8ea5-779496a8ac53/' \
-H 'accept: application/json' \
-H 'X-API-Key: REDACTED'
Response
Code: 200
Body:
true
Resource doesn't exists (anymore)
Call
curl -X 'DELETE' \
'https://sandbox.api.credentials.dev/v1/people/34a36028-dddc-477f-9676-ceb75089658a/documents/c2141f12-8d69-47d1-8ea5-779496a8ac53/' \
-H 'accept: application/json' \
-H 'X-API-Key: REDACTED'
Response
Code: 200
Body:
false
[API] DocumentValidation property "validated_by" not marked nullable
The DocumentValidation
property validated_by
is defined as type string, but the API responds/can respond with null.
I'd suggest to add "nullable": true
to the property.
[API] unable to get all documents related to a person
Get all documents related to a person /v1/people/{person_id}/documents/
curl -X 'GET' \
'https://sandbox.api.credentials.dev/v1/people/34a36028-dddc-477f-9676-ceb75089658a/documents/' \
-H 'accept: application/json' \
-H 'X-API-Key: REDACTED'
The requests results in a 500 Internal Server Error
response. Requesting a person's details, contains a list of its documents.
curl -X 'GET' \
'https://sandbox.api.credentials.dev/v1/people/34a36028-dddc-477f-9676-ceb75089658a/' \
-H 'accept: application/json' \
-H 'X-API-Key: REDACTED'
{
"created_at": "2022-12-27T13:09:31.443720",
"id": "34a36028-dddc-477f-9676-ceb75089658a",
"tenant_id": "b25eb48b-abbd-46c5-a1bc-146fab1a1f58",
"external_identifier": "string",
"documents": [
{
"created_at": "2022-12-27T13:33:50.098073",
"id": "fe3c44b4-86c1-4cd7-9335-bd183b4f48d1",
"external_identifier": "string",
"validations": []
}
]
}
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.