Coder Social home page Coder Social logo

Comments (13)

sebastiankb avatar sebastiankb commented on July 20, 2024 1

I think the produce() should provide a way to override the default assumptions in node-wot (also in forms). E.g.,

WoT.produce({
		"@context": "https://www.w3.org/2019/wot/td/v1",
		title: "camera",
		properties: {
			myPhote: {
				description: "Latest cached photo",
				readOnly: true
				forms: [{contentType:"image/jpeg"}]
			}

The contentType provided in forms should override the default application/json in node-wot.

from node-wot.

egekorkan avatar egekorkan commented on July 20, 2024 1

There is #187 so I would wait the progress there :)

from node-wot.

mkovatsc avatar mkovatsc commented on July 20, 2024

This is more a topic for https://github.com/w3c/wot-scripting-api/issues

from node-wot.

egekorkan avatar egekorkan commented on July 20, 2024

I have commented on the issue #112 of the scripting api specification.

from node-wot.

danielpeintner avatar danielpeintner commented on July 20, 2024

@egekorkan can we close this issue given that w3c/wot-scripting-api#112 is closed too?

from node-wot.

egekorkan avatar egekorkan commented on July 20, 2024

Actually, I have written another issue in the scripting API ( 156 ). The ambiguity is the fact that the scripting API says to accept a TD for the expose method but actually the algorithm should decide how to init the exposed thing. In this case it is not clear whether not having this feature is the "fault" of node-wot or scripting API

from node-wot.

egekorkan avatar egekorkan commented on July 20, 2024

From the discussion in Scripting API on issue 156, at the moment it is up to the implementation to figure out how to interpret the form field of a given TD for the produce() method. This means that we can (and I think we should) use the information provided in the form field. At the moment it is completely ignored.

from node-wot.

danielpeintner avatar danielpeintner commented on July 20, 2024

@egekorkan any update?

from node-wot.

egekorkan avatar egekorkan commented on July 20, 2024

Nothing from my side...

from node-wot.

egekorkan avatar egekorkan commented on July 20, 2024

There is also a need/usecase for this by @jenlincode

from node-wot.

relu91 avatar relu91 commented on July 20, 2024

If no one is on this issue, I could give a hand and propose an implementation for merging form configurations with the defaults. I am wondering what will happen if the codec for the contentType specified in the form is not defined? Should we raise an error immediately?

from node-wot.

danielpeintner avatar danielpeintner commented on July 20, 2024

Thanks @relu91,

as @egekorkan mentioned I did started exploring a bit how it could be done.

It seems a bit hacky so please comment or make suggestions in the PR #187

from node-wot.

danielpeintner avatar danielpeintner commented on July 20, 2024

PR #187 merged

from node-wot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.