You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To prepare for serverless and versioned HTTP apis, we need to isolate our api interfaces from our saved object interfaces.
APIs whose interface directly references saved objects fields must be updated to remove those references, opting instead to separate out the HTTP interface from any saved object fields reference and transform the request to saved object fields when necessary.
The HTTP versioning doc states:
Your HTTP route should not return SO-attribs as-is. You need to use two TypeScript interfaces, one for your HTTP route and one for your SO-attribs, even if they are exactly the same.
In particular, the synthetics get and edit monitor APIs rely on the client to directly provide the SO interface for writes and updates, and directly returns the saved object attributes wholesale on reads.
We'll need to separate out the HTTP schema for creating and updating and monitors from the existing SyntheticsMonitor and EncryptedSyntheticsMonitor schema.
We might want to rename the existing SyntheticsMonitor and EncryptedSyntheticsMonitor interfaces to SyntheticsMonitorAttributes and EncryptedSyntheticsMonitorAttributes and create new to create a new typescript interface, SyntheticsMonitor and EncryptedSyntheticsMonitor that represents the interface returned from the HTTP. These two interfaces need to be separate and maintained separately, even if they are exactly the same currently.
The text was updated successfully, but these errors were encountered:
Relates to #153469
To prepare for serverless and versioned HTTP apis, we need to isolate our api interfaces from our saved object interfaces.
APIs whose interface directly references saved objects fields must be updated to remove those references, opting instead to separate out the HTTP interface from any saved object fields reference and transform the request to saved object fields when necessary.
The HTTP versioning doc states:
In particular, the synthetics get and edit monitor APIs rely on the client to directly provide the SO interface for writes and updates, and directly returns the saved object attributes wholesale on reads.
https://github.com/elastic/kibana/blob/main/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor.ts#L61
https://github.com/elastic/kibana/blob/main/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.ts#L56
We'll need to separate out the HTTP schema for creating and updating and monitors from the existing
SyntheticsMonitor
andEncryptedSyntheticsMonitor
schema.https://github.com/elastic/kibana/blob/main/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types.ts#L321
https://github.com/elastic/kibana/blob/main/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types.ts#LL438
We might want to rename the existing
SyntheticsMonitor
andEncryptedSyntheticsMonitor
interfaces toSyntheticsMonitorAttributes
andEncryptedSyntheticsMonitorAttributes
and create new to create a new typescript interface,SyntheticsMonitor
andEncryptedSyntheticsMonitor
that represents the interface returned from the HTTP. These two interfaces need to be separate and maintained separately, even if they are exactly the same currently.The text was updated successfully, but these errors were encountered: