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

Move TD generation to within the affordance objects and support server side validation (with pydantic) #14

Open
VigneshVSV opened this issue Jul 23, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@VigneshVSV
Copy link
Owner

VigneshVSV commented Jul 23, 2024

Currently the thing description is generated in a separate class (hololinked.server.td.ThingDescription). However, it seems to be better to generate it in the handler of the affordance itself. In this way, it can also be accessed as an attribute of the affordance itself.

This will also help people define affordances and simply see what affordance schema is being generated.

For property and event, there are implementations called Property and Event. For actions, there is no such class.

Possibly involved steps

  • For property and event, create new method that returns the affordance schema
  • For the typed properties, decide where to place the specific data schema for each type
  • For actions, create a class/object Action with a __call__ which will handle the calling and a method that returns the schema.

There is a rough implementation in labthings-fastapi , it would useful to copy that once license details are sorted out.

@VigneshVSV VigneshVSV added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 23, 2024
@VigneshVSV VigneshVSV changed the title Move TD generation to within the affordance objects Move TD generation to within the affordance objects and support server side validation (with pydantic) Jul 27, 2024
@VigneshVSV VigneshVSV removed the good first issue Good for newcomers label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant