HTTP-APIs / hydra-python-agent

Python Hydra smart client and test console
MIT License
22 stars 42 forks source link

[FEATURE] Expose convenient interfaces by agent #150

Open priyanshunayan opened 4 years ago

priyanshunayan commented 4 years ago

I'm submitting a

Current Behaviour:

Presently Agent provides only CRUD operations for developers to interact with the APIDOC. It would be helpful to expose different methods like getSupportedOperations or getMembers. These methods can allow developers to take actions programatically, instead of parsing the response themselves. It would be nice to have methods similar as reference implementation: https://github.com/HydraCG/Heracles.ts/tree/master/docs#functions.

Expected Behaviour:

One would be able to query from the dict like they normally do. for eg: res.members to get members of the collections.

Steps to reproduce:

NA

Do you want to work on this issue?

yes

xadahiya commented 4 years ago

Not a bad idea! @chrizandr what do you think?

chrizandr commented 4 years ago

Yes this seems useful. Heracles already parses the response of the API, we should try something similar. I don't think getSupportedOperations would be a part of the response object, we already have supported operations in core library when the API Doc is parsed into the HydraDoc object.

It would be a good idea to consolidate how responses can be stored as python objects and how we parse the API responses, this would be a great addition to the core library and then we could use core in agent.