Configuring the output format
The endpoint output format is the format of the data that the endpoint returns when consumed. Suppose you publish a Snapi-based endpoint such as:
main() =
let
data = MySQL.InferAndRead("mysql001", "products")
in
Collection.Filter(data, x -> x.stockcount < 5)
This endpoint reads a MySQL table. But what is the format of the REST API we published?
In RAW, you can choose this as part of the endpoint settings. RAW currently supports the following formats:
- JSON
- CSV
warning
Note that some formats like CSV will not be available for all data types. For instance, if your Snapi code returns a data type that cannot be supported when formatted as CSV (e.g. nested collections, ora binary data), the endpoint publication will fail. The chosen format must support the data returned by the Snapi function.