Skip to content

Gateway adds Forms implying application/json even if an add-on specifies a different contentType #3230

@benfrancis

Description

@benfrancis

STR:

  • Install the Virtual Things add-on
  • Add a video camera Thing (or camera Thing)

Expected:

  • The Thing Description just contains the Forms provided for the video property by the add-on:
        "forms": [
          {
            "op": "readproperty",
            "href": "/media/virtual-things/index.mpd",
            "contentType": "application/dash+xml"
          },
          {
            "op": "readproperty",
            "href": "/media/virtual-things/master.m3u8",
            "contentType": "application/vnd.apple.mpegurl"
          }
        ]

Actual:

  • The gateway adds additional forms which imply the video (or image) property can also be read as JSON and observed using SSE, which is not true:
        "forms": [
          {
            "op": "readproperty",
            "href": "/media/virtual-things/index.mpd",
            "contentType": "application/dash+xml"
          },
          {
            "op": "readproperty",
            "href": "/media/virtual-things/master.m3u8",
            "contentType": "application/vnd.apple.mpegurl"
          },
          {
            "href": "/things/virtual-things-20/properties/video"
          },
          {
            "href": "/things/virtual-things-20/properties/video",
            "op": [
              "observeproperty",
              "unobserveproperty"
            ],
            "subprotocol": "sse"
          }
        ]

If an add-on specifies a custom Form for an InteractionAffordance with a different contentType then we should probably not add the default application/json Forms. We need to make sure this is still possible for the add-on to specify itself if JSON really is also supported.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions