Skip to content

Commit 7dc78af

Browse files
authored
Merge pull request #23 from amplitude/thomas.kainrad/sync-snooze-object-fix
fix(guides,surveys): parse update config flags as JSON objects
2 parents fc91e0a + b03debe commit 7dc78af

4 files changed

Lines changed: 175 additions & 161 deletions

File tree

‎openapi/bundled/openapi.bundled.json‎

Lines changed: 78 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -4397,10 +4397,12 @@
43974397
},
43984398
"trigger_config": {
43994399
"type": "object",
4400+
"additionalProperties": true,
44004401
"description": "Trigger configuration object."
44014402
},
44024403
"lifecycle": {
44034404
"type": "object",
4405+
"additionalProperties": true,
44044406
"description": "Lifecycle rules object."
44054407
},
44064408
"dismissible": {
@@ -4413,6 +4415,8 @@
44134415
"type": "boolean"
44144416
},
44154417
"snooze_duration": {
4418+
"type": "object",
4419+
"additionalProperties": true,
44164420
"description": "Snooze duration configuration."
44174421
},
44184422
"snooze_label": {
@@ -4827,10 +4831,12 @@
48274831
},
48284832
"trigger_config": {
48294833
"type": "object",
4834+
"additionalProperties": true,
48304835
"description": "Trigger configuration object."
48314836
},
48324837
"lifecycle": {
48334838
"type": "object",
4839+
"additionalProperties": true,
48344840
"description": "Lifecycle rules object."
48354841
},
48364842
"dismissible": {
@@ -4843,6 +4849,8 @@
48434849
"type": "boolean"
48444850
},
48454851
"snooze_duration": {
4852+
"type": "object",
4853+
"additionalProperties": true,
48464854
"description": "Snooze duration configuration."
48474855
},
48484856
"snooze_label": {
@@ -7099,7 +7107,10 @@
70997107
"Guide": {
71007108
"allOf": [
71017109
{
7102-
"$ref": "#/components/schemas/GuideSurvey"
7110+
"$ref": "#/components/schemas/GuideSurveySummary"
7111+
},
7112+
{
7113+
"$ref": "#/components/schemas/GuideSurveyDetail"
71037114
},
71047115
{
71057116
"type": "object",
@@ -7139,7 +7150,10 @@
71397150
"Survey": {
71407151
"allOf": [
71417152
{
7142-
"$ref": "#/components/schemas/GuideSurvey"
7153+
"$ref": "#/components/schemas/GuideSurveySummary"
7154+
},
7155+
{
7156+
"$ref": "#/components/schemas/GuideSurveyDetail"
71437157
},
71447158
{
71457159
"type": "object",
@@ -9545,79 +9559,72 @@
95459559
}
95469560
}
95479561
},
9548-
"GuideSurvey": {
9549-
"allOf": [
9550-
{
9551-
"$ref": "#/components/schemas/GuideSurveySummary"
9562+
"GuideSurveyDetail": {
9563+
"type": "object",
9564+
"properties": {
9565+
"temporarily_hide_page_target_segments": {
9566+
"type": "array",
9567+
"items": {}
95529568
},
9553-
{
9554-
"type": "object",
9555-
"properties": {
9556-
"temporarily_hide_page_target_segments": {
9557-
"type": "array",
9558-
"items": {}
9559-
},
9560-
"hide_if_page_targeting_not_met": {
9561-
"type": "boolean"
9562-
},
9563-
"trigger_config": {
9564-
"description": "When and how the nudge triggers."
9565-
},
9566-
"lifecycle": {
9567-
"description": "Frequency and display lifecycle rules."
9568-
},
9569-
"dismissible": {
9570-
"type": "boolean"
9571-
},
9572-
"snoozable": {
9573-
"type": "boolean"
9574-
},
9575-
"snoozable_on_all_steps": {
9576-
"type": "boolean"
9577-
},
9578-
"snooze_duration": {
9579-
"description": "Snooze duration configuration."
9580-
},
9581-
"snooze_label": {
9582-
"type": ["string", "null"]
9583-
},
9584-
"template_source": {
9585-
"type": ["string", "null"]
9586-
},
9587-
"show_step_counter": {
9588-
"type": "boolean"
9589-
},
9590-
"step_counter_format": {
9591-
"type": ["string", "null"]
9592-
},
9593-
"variants": {
9594-
"type": "array",
9595-
"items": {
9596-
"$ref": "#/components/schemas/GuideSurveyVariant"
9597-
}
9598-
},
9599-
"experiment_variants": {
9600-
"type": "array",
9601-
"items": {
9602-
"$ref": "#/components/schemas/ExperimentVariantSummary"
9603-
},
9604-
"description": "Read-only experiment variant keys when the nudge is experiment-backed."
9569+
"hide_if_page_targeting_not_met": {
9570+
"type": "boolean"
9571+
},
9572+
"trigger_config": {
9573+
"description": "When and how the nudge triggers."
9574+
},
9575+
"lifecycle": {
9576+
"description": "Frequency and display lifecycle rules."
9577+
},
9578+
"dismissible": {
9579+
"type": "boolean"
9580+
},
9581+
"snoozable": {
9582+
"type": "boolean"
9583+
},
9584+
"snoozable_on_all_steps": {
9585+
"type": "boolean"
9586+
},
9587+
"snooze_duration": {
9588+
"description": "Snooze duration configuration."
9589+
},
9590+
"snooze_label": {
9591+
"type": ["string", "null"]
9592+
},
9593+
"template_source": {
9594+
"type": ["string", "null"]
9595+
},
9596+
"show_step_counter": {
9597+
"type": "boolean"
9598+
},
9599+
"step_counter_format": {
9600+
"type": ["string", "null"]
9601+
},
9602+
"variants": {
9603+
"type": "array",
9604+
"items": {
9605+
"$ref": "#/components/schemas/GuideSurveyVariant"
9606+
}
9607+
},
9608+
"experiment_variants": {
9609+
"type": "array",
9610+
"items": {
9611+
"$ref": "#/components/schemas/ExperimentVariantSummary"
9612+
},
9613+
"description": "Read-only experiment variant keys when the nudge is experiment-backed."
9614+
},
9615+
"flag_config": {
9616+
"oneOf": [
9617+
{
9618+
"$ref": "#/components/schemas/FeatureFlag"
96059619
},
9606-
"flag_config": {
9607-
"oneOf": [
9608-
{
9609-
"$ref": "#/components/schemas/FeatureFlag"
9610-
},
9611-
{
9612-
"type": "null"
9613-
}
9614-
],
9615-
"readOnly": true,
9616-
"description": "The Experiment feature flag that delivers this nudge, in the same\nshape as the Feature Flags API. Includes audience targeting\n(`target_segments`) and rollout. With\n`include_unpublished_changes=true`, draft rollout and targeting\nsettings are applied over the live flag.\n"
9620+
{
9621+
"type": "null"
96179622
}
9618-
}
9623+
],
9624+
"readOnly": true,
9625+
"description": "The Experiment feature flag that delivers this nudge, in the same\nshape as the Feature Flags API. Includes audience targeting\n(`target_segments`) and rollout. With\n`include_unpublished_changes=true`, draft rollout and targeting\nsettings are applied over the live flag.\n"
96199626
}
9620-
]
9627+
}
96219628
},
96229629
"DestinationConnectorKind": {
96239630
"type": "string",

‎openapi/bundled/openapi.bundled.yaml‎

Lines changed: 66 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3308,9 +3308,11 @@ paths:
33083308
type: boolean
33093309
trigger_config:
33103310
type: object
3311+
additionalProperties: true
33113312
description: Trigger configuration object.
33123313
lifecycle:
33133314
type: object
3315+
additionalProperties: true
33143316
description: Lifecycle rules object.
33153317
dismissible:
33163318
type: boolean
@@ -3319,6 +3321,8 @@ paths:
33193321
snoozable_on_all_steps:
33203322
type: boolean
33213323
snooze_duration:
3324+
type: object
3325+
additionalProperties: true
33223326
description: Snooze duration configuration.
33233327
snooze_label:
33243328
type:
@@ -3640,9 +3644,11 @@ paths:
36403644
type: boolean
36413645
trigger_config:
36423646
type: object
3647+
additionalProperties: true
36433648
description: Trigger configuration object.
36443649
lifecycle:
36453650
type: object
3651+
additionalProperties: true
36463652
description: Lifecycle rules object.
36473653
dismissible:
36483654
type: boolean
@@ -3651,6 +3657,8 @@ paths:
36513657
snoozable_on_all_steps:
36523658
type: boolean
36533659
snooze_duration:
3660+
type: object
3661+
additionalProperties: true
36543662
description: Snooze duration configuration.
36553663
snooze_label:
36563664
type:
@@ -5550,7 +5558,8 @@ components:
55505558
description: Resource-type discriminator. Always `feature_flag`.
55515559
Guide:
55525560
allOf:
5553-
- $ref: '#/components/schemas/GuideSurvey'
5561+
- $ref: '#/components/schemas/GuideSurveySummary'
5562+
- $ref: '#/components/schemas/GuideSurveyDetail'
55545563
- type: object
55555564
properties:
55565565
object:
@@ -5572,7 +5581,8 @@ components:
55725581
const: GUIDE
55735582
Survey:
55745583
allOf:
5575-
- $ref: '#/components/schemas/GuideSurvey'
5584+
- $ref: '#/components/schemas/GuideSurveySummary'
5585+
- $ref: '#/components/schemas/GuideSurveyDetail'
55765586
- type: object
55775587
properties:
55785588
object:
@@ -7688,62 +7698,60 @@ components:
76887698
- 'null'
76897699
payload:
76907700
description: Optional JSON payload associated with the experiment variant.
7691-
GuideSurvey:
7692-
allOf:
7693-
- $ref: '#/components/schemas/GuideSurveySummary'
7694-
- type: object
7695-
properties:
7696-
temporarily_hide_page_target_segments:
7697-
type: array
7698-
items: {}
7699-
hide_if_page_targeting_not_met:
7700-
type: boolean
7701-
trigger_config:
7702-
description: When and how the nudge triggers.
7703-
lifecycle:
7704-
description: Frequency and display lifecycle rules.
7705-
dismissible:
7706-
type: boolean
7707-
snoozable:
7708-
type: boolean
7709-
snoozable_on_all_steps:
7710-
type: boolean
7711-
snooze_duration:
7712-
description: Snooze duration configuration.
7713-
snooze_label:
7714-
type:
7715-
- string
7716-
- 'null'
7717-
template_source:
7718-
type:
7719-
- string
7720-
- 'null'
7721-
show_step_counter:
7722-
type: boolean
7723-
step_counter_format:
7724-
type:
7725-
- string
7726-
- 'null'
7727-
variants:
7728-
type: array
7729-
items:
7730-
$ref: '#/components/schemas/GuideSurveyVariant'
7731-
experiment_variants:
7732-
type: array
7733-
items:
7734-
$ref: '#/components/schemas/ExperimentVariantSummary'
7735-
description: Read-only experiment variant keys when the nudge is experiment-backed.
7736-
flag_config:
7737-
oneOf:
7738-
- $ref: '#/components/schemas/FeatureFlag'
7739-
- type: 'null'
7740-
readOnly: true
7741-
description: |
7742-
The Experiment feature flag that delivers this nudge, in the same
7743-
shape as the Feature Flags API. Includes audience targeting
7744-
(`target_segments`) and rollout. With
7745-
`include_unpublished_changes=true`, draft rollout and targeting
7746-
settings are applied over the live flag.
7701+
GuideSurveyDetail:
7702+
type: object
7703+
properties:
7704+
temporarily_hide_page_target_segments:
7705+
type: array
7706+
items: {}
7707+
hide_if_page_targeting_not_met:
7708+
type: boolean
7709+
trigger_config:
7710+
description: When and how the nudge triggers.
7711+
lifecycle:
7712+
description: Frequency and display lifecycle rules.
7713+
dismissible:
7714+
type: boolean
7715+
snoozable:
7716+
type: boolean
7717+
snoozable_on_all_steps:
7718+
type: boolean
7719+
snooze_duration:
7720+
description: Snooze duration configuration.
7721+
snooze_label:
7722+
type:
7723+
- string
7724+
- 'null'
7725+
template_source:
7726+
type:
7727+
- string
7728+
- 'null'
7729+
show_step_counter:
7730+
type: boolean
7731+
step_counter_format:
7732+
type:
7733+
- string
7734+
- 'null'
7735+
variants:
7736+
type: array
7737+
items:
7738+
$ref: '#/components/schemas/GuideSurveyVariant'
7739+
experiment_variants:
7740+
type: array
7741+
items:
7742+
$ref: '#/components/schemas/ExperimentVariantSummary'
7743+
description: Read-only experiment variant keys when the nudge is experiment-backed.
7744+
flag_config:
7745+
oneOf:
7746+
- $ref: '#/components/schemas/FeatureFlag'
7747+
- type: 'null'
7748+
readOnly: true
7749+
description: |
7750+
The Experiment feature flag that delivers this nudge, in the same
7751+
shape as the Feature Flags API. Includes audience targeting
7752+
(`target_segments`) and rollout. With
7753+
`include_unpublished_changes=true`, draft rollout and targeting
7754+
settings are applied over the live flag.
77477755
DestinationConnectorKind:
77487756
type: string
77497757
enum:

0 commit comments

Comments
 (0)