eclipse-thingweb / eclipse-thingweb/td-tools

Parsing, Default Manipulation and Validation Discussion

Open
#31 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
6
Forks
11
Avg merge
1d 15h
Merged PRs (30d)
4

Description

In #3 there were discussions on what to do to align "parsing", validation and default manipulation between playground and node-wot. I think there should be one codebase that does all that among Node.js based Thingweb components and we have some work to do towards that. Below are the important remarks from #3:

- node-wot td parser, in consuming step, corrects user inputs (if readonly is not boolean, it is corrected to boolean) and fills defaults. This can be done by the core package as this is not needed as an external tool
- We should align the default addition mechanism to use ajv and share the library between playground web and node-wot. A JSON Schema can contain default values already. Anything that needs conditions (if readOnly: false, op has writeproperty) can be programmed on top.
- [td-parser.ts](https://github.com/eclipse-thingweb/node-wot/blob/master/packages/td-tools/src/td-parser.ts): maybe rename it since it is a serializer as well or split the functionality
- [resolver-interface.ts](https://github.com/eclipse-thingweb/node-wot/blob/master/packages/td-tools/src/resolver-interface.ts): not sure whether we actually need this interface used by helpers and thing-model
- [td-helpers.ts](https://github.com/eclipse-thingweb/node-wot/blob/master/packages/td-tools/src/td-helpers.ts): has little functionality, maybe can be moved into node-wot/core
- Dependencies mentioned in comments there are now resolved

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.