W3C home > Mailing lists > Public > public-automotive@w3.org > November 2019

New REST API support in w3c-visserver-api

From: FIXED-TERM Miladinovic Bojan (RBSN/ESW22) <fixed-term.Bojan.Miladinovic@se.bosch.com>
Date: Tue, 26 Nov 2019 11:54:15 +0000
To: "public-automotive@w3.org" <public-automotive@w3.org>
Message-ID: <71f2625bbea7dd417be8419b9db7588e020215f8.camel@bosch.com>
Hi all,

I would like to announce experimental REST API support as a new feature of w3c-visserver-api.

Feature is already merged and available in w3c-visserver-api<https://github.com/eclipse/kuksa.invehicle/tree/master/w3c-visserver-api> git repo with an updated README.md<https://github.com/eclipse/kuksa.invehicle/blob/master/w3c-visserver-api/README.md> with more details.

In short:

  *   Both Web-Socket and REST are supported at the same time. Extending/improving of REST API support is fairly straight-forward as REST API handler generates valid JSON requests toward single lower-level handler.


  *   Depending on server security configuration, both Web-Socket and REST can use both plain and TLS protected connection.


  *   Existing support for get/set/getmetadata/authorize requests is fully mimicked to match current implementation and its limitations. Any limitations (e.g. setting of multiple signals in single request, complex queries, ...) are currently not supported on both Web-Socket and REST API. Due to this, any data sent in REST request body is ignored (e.g. json data).


  *   'subscribe/unsubscribe'  requests are not supported, due to default natural flow of REST client -> server HTTP communication. If needed, support for them could be added in the future, but with some 'stretching' of regular HTTP connection flow.


  *   Initial REST API documentation is provided in open-source 'OpenAPI' 3.0.1 format. Additional benefit of 'OpenAPI' format is posibility of automatic generation of interactive documentation direcly exercising defined REST API. Depending on tool used, both test client and server can be automatically generated. File rest-api.yaml<https://github.com/eclipse/kuksa.invehicle/blob/master/w3c-visserver-api/doc/rest-api.yaml> describes currently implemented REST API. How to use is described in this chapter<https://github.com/eclipse/kuksa.invehicle/tree/master/w3c-visserver-api#rest-api-specific-testing> of README.md.


Example for both features active at the same time could be found in use-case where more complex 'feeders' use Web-Socket connections to populate data, while 'thin' clients can get data through REST API from the server without the need to maintain Web-Socket connection.

Please be free to take a look and play with the current implementation.
Any comments and pull requests are highly welcome.


All the best,
Bojan
Received on Tuesday, 26 November 2019 11:54:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:06:14 UTC