rwx-yxu / inventory

Inventory application that uses openfaas to deploy an api backend and vuejs front end.
0 stars 0 forks source link

Improve api json message responses. #6

Open rwx-yxu opened 2 years ago

rwx-yxu commented 2 years ago

Currently the response returned by the api contains whatever data you need.

Such as { updatedAt:3218733 }

{ invalid fields in post request }

This should be standardized and predictable to make it easier for the front end to consume. https://github.com/carlmjohnson/resperr is a interesting package to look into for errors but it could provide inspiration to how I should be thinking about my own responses.

rwx-yxu commented 2 years ago

Turns out that there isn't a specific standard for JSON response formats. There are attempts at some formatting. https://stackoverflow.com/questions/12806386/is-there-any-standard-for-json-api-response-format