*Aka Data Virtualization Transformers, but with the french touch
Since I’ve been publishing a bunch of Data Virtualization custom transformers lately, I figured it was time to make a post about them—what they do and how to use them.
FME Flow’s recent update introduced a cool new feature: Data Virtualization.
https://community.safe.com/product-updates/introducing-fme-data-virtualization-38066?tid=38066&postid=86#post86
This feature lets you build your own APIs using FME workbenches.
To make that work, your features need to include certain attributes required by the Data Virtualization writer, such as:
-
response.status_code
-
response.body.content
-
response.body.content_type
-
response.body.content_file_path
-
response.headers{}.name
-
response.headers{}.value

After manually setting these with an AttributeCreator a few times, I thought: why not create a tool to make this easier?
So I made the DataVirtualizationResponseSetter !
DataVirtualizationResponseSetter

This transformer takes care of setting all the required attributes, and gives you a list of predefined values for common fields like response code and content type.
While this helps format your features for FME, you still need to build your JSON responses manually—using AttributeCreators, JSONTemplaters, etc.
To help with that part, I’ve published three new transformers:
DataVirtualizationJSONList

It turns incoming features into a structured JSON array and sets the proper HTTP response attributes.
Example output:
{
"data": [
{ "mail": "alice@example.com", "name": "Alice" },
{ "mail": "bob@example.com", "name": "Bob" },
{ "mail": "carol@example.com", "name": "Carol" }
]
}
DataVirtualizationJSONPaginate

This one handles pagination and includes metadata in the response, so it's great for building paginated API endpoints.
Example:
{
"data": [
{ "id": 101, "name": "Item 101" },
{ "id": 102, "name": "Item 102" }
],
"meta": {
"offset": 100,
"limit": 2,
"total": 1000
}
}
DataVirtualizationGeoJSON

This one generates valid GeoJSON from spatial features and wraps everything up nicely into a FeatureCollection
.
Example:
{
"type": "FeatureCollection",
"name": "example",
"features": [
{
"type": "Feature",
"geometry": { ... },
"properties": {
"CODE_DEPT": "39",
"NOM_DEPT": "JURA",
...
}
},
...
]
}
Hopefully these transformers help you build your own JSON REST APIs with FME Flow's Data Virtualization.
They're open, so feel free to explore or tweak them however you like. Feedback and suggestions are very welcome!
Check out my FME Hub publisher page to find out about my other tools