Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide japi handler that lists registered commands #27

Closed
fraunhofer-iis-bot opened this issue Feb 27, 2020 · 6 comments · Fixed by #116
Closed

Provide japi handler that lists registered commands #27

fraunhofer-iis-bot opened this issue Feb 27, 2020 · 6 comments · Fixed by #116
Assignees
Milestone

Comments

@fraunhofer-iis-bot
Copy link
Collaborator

In GitLab by @jannismain on Feb 27, 2020, 17:23

Summary

Provide JAPI command to discover commands registered with the controller.

Explanation

Similar to how push services can be discovered via the japi_pushsrv_list command, discovering registered japi commands via japi_cmd_list would be helpful in client development:

-> {"japi_request": "japi_cmd_list"}
<- {"japi_response": "japi_cmd_list", "data": {"commands": ["get_temperature", ...]}}

Alternatively, a slightly different API would provide even more utility:

-> {"japi_request": "japi_cmd_list"}
<- {"japi_response": "japi_cmd_list", "data": {"get_temperature": {"unit": "celsius"}, ...}}

Here, in addition to the command name (as key of data object), the accepted arguments and their default values are returned.

@fraunhofer-iis-bot
Copy link
Collaborator Author

In GitLab by @cstender on Mar 25, 2020, 08:49

Maybe this can be implemented together with the JSON schema validator since both features require knowledge about the json structure.

@fraunhofer-iis-bot
Copy link
Collaborator Author

In GitLab by @jannismain on Apr 30, 2021, 17:27

This feature is required by our general libjapi webframework in order to discover, which capabilities the server has (i.e. which requests it accepts).

@fraunhofer-iis-bot
Copy link
Collaborator Author

In GitLab by @cstender on May 4, 2021, 17:28

The first option is easy and could be implemented soon. The second option is really nice, but requires a formal JSON schema description of each/all requests.

@fraunhofer-iis-bot
Copy link
Collaborator Author

In GitLab by @jannismain on May 5, 2021, 08:25

Yes, I agree that some formal description of each JSON command would be required to implement the second approach.

For a general libjapi web client, this feature would allow to have the same client work with many different libjapi backends, which would further increase the usefulness of libjapi (because no custom client will be required at all for routine tasks).

For now, the libjapi web framework doesn't strictly need the second approach. The first one would suffice to at least verify, that the assumptions the client makes about the server are somewhat true.

@fraunhofer-iis-bot
Copy link
Collaborator Author

In GitLab by @cstender on May 5, 2021, 09:07

I really like the second approach as it would also allow a generic mobile app.

Nevertheless, let's implement the first version and later we can enhance it.

@fraunhofer-iis-bot
Copy link
Collaborator Author

In GitLab by @vornkat-iis on Jul 4, 2023, 15:16

created branch 27-provide-japi-handler-that-lists-registered-commands to address this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants