monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.53k stars 2.15k forks source link

add json schema to api docs #2151

Open pixelyo opened 5 years ago

pixelyo commented 5 years ago

Is your feature request related to a problem? Please describe.

it is really hard to get behind the api. when coding in a type-save language it is hard to convert a received json into a usable object.

for example: https://app.quicktype.io?share=kwYLvUf0kZlJklI9hfmQ

it gives me only half the truth of what is optional/nullable

Describe the solution you'd like It would be great to have the json schemas available from the api documentation

djaiss commented 5 years ago

I don't understand. Isn't the documentation (like https://www.monicahq.com/api/contactfields) useful and doing exactly what you are requesting here? How can it be better or how can it answer your need?

pixelyo commented 5 years ago

I don't understand. Isn't the documentation (like https://www.monicahq.com/api/contactfields) useful and doing exactly what you are requesting here?

well yea, it is already helping, but it is giving only an example for an answer for a request. It would be more useful to state an exact explanation of which keys/values are optional and what data type a key is holding. A good way to do that is using json schemes.

How can it be better or how can it answer your need?

I think generally it is ok how it answers, I can work with it. I am just having a hard time to handle the result right now, bc I have to expect optional values/keys and sometimes it is also hard to guess what data type is behind a key.