-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with some example package values #42
Comments
This is actually a mistake made on my end I think. In Beats (from where I copied the data) we decode the JSON object for easier versioning (nice diffs). So the objects above have to be JSON encoded to work. There are script in the Beats project that do this automatically but we need to change this data to be compatible and decide later on how we better version it (especially as this are only examples). |
The Integrations Manager converts them to JSON in https://github.com/elastic/kibana/blob/feature-integrations-manager/x-pack/legacy/plugins/integrations_manager/server/integrations/get_objects.ts#L54 if you want to see all the keys to update |
@exekias We should discuss the format we want to have it in the package in the end for the Saved object json parts. If we let it encoded, it will be easier for contributors to just copy / paste their asset from Kibana. The downsides are that during development, diffs are impossible to read and is the reason we have it decoded in the modules repo so far. |
In the packages, the saved objects are stored with decoded JSON fields. The reason is that this makes versioning of it much easier and the diffs are simpler. But inside Kibana some of the fields are stored as encoded json strings (this might change in the future elastic/kibana#43673). To not require special logic on the Package Manager to encode the strings, this is done directly during packaging. One thing not too nice about this PR is that it includes now a dependency on `common.MapStr` from Beats. Reason is that it makes the code much simpler. Part of elastic#42
In the packages, the saved objects are stored with decoded JSON fields. The reason is that this makes versioning of it much easier and the diffs are simpler. But inside Kibana some of the fields are stored as encoded json strings (this might change in the future elastic/kibana#43673). To not require special logic on the Package Manager to encode the strings, this is done directly during packaging. One thing not too nice about this PR is that it includes now a dependency on `common.MapStr` from Beats. Reason is that it makes the code much simpler. Part of #42
Closing as #157 was merged. |
With elastic/package-registry#157 issue elastic/package-registry#42 has been resolved. This means the code to encode some of the Kibana fields is not needed anymore.
JSON vs JS objects
Any
searchSourceJSON
,optionsJSON
,panelsJSON
,uiStateJSON
, andvisState
fields indev/package-template
should be JSON strings, not JS objects.I attempted to
bulkCreate
them and got aJSON.parse
error about[object Object]
. The error started in a kibana migration handler and I worked backwards the issues in these keys.I don’t know if there are docs/schemas about this but the
sample_data/data_sets
have examplesInvalid JSON
The example ingest pipeline has invalid JSON at line 14

The text was updated successfully, but these errors were encountered: