diff --git a/src/sentry/api/serializers/rest_framework/project.py b/src/sentry/api/serializers/rest_framework/project.py index 66f3f3d4dd8a75..6c770ca59df601 100644 --- a/src/sentry/api/serializers/rest_framework/project.py +++ b/src/sentry/api/serializers/rest_framework/project.py @@ -9,10 +9,10 @@ @extend_schema_field(field=OpenApiTypes.STR) class ProjectField(serializers.Field): - def __init__(self, scope="project:write", id_allowed=False): + def __init__(self, scope="project:write", id_allowed=False, **kwags): self.scope = scope self.id_allowed = id_allowed - super().__init__() + super().__init__(**kwags) def to_representation(self, value): return value diff --git a/src/sentry/monitors/validators.py b/src/sentry/monitors/validators.py index 76d0468508082d..00bd53f36ee378 100644 --- a/src/sentry/monitors/validators.py +++ b/src/sentry/monitors/validators.py @@ -244,12 +244,16 @@ def validate(self, attrs): return attrs -@extend_schema_serializer(exclude_fields=["project", "config", "alert_rule"]) +@extend_schema_serializer(exclude_fields=["alert_rule"]) class MonitorValidator(CamelSnakeSerializer): - project = ProjectField(scope="project:read") + project = ProjectField( + scope="project:read", + required=True, + help_text="The project to associate the monitor to.", + ) name = serializers.CharField( max_length=128, - help_text="Name of the monitor. Used for notifications.", + help_text="Name of the monitor. Used for notifications. If not set the slug will be derived from your monitor name.", ) slug = SentrySerializerSlugField( max_length=DEFAULT_SLUG_MAX_LENGTH, @@ -275,7 +279,7 @@ class MonitorValidator(CamelSnakeSerializer): required=False, default="cron_job", ) - config = ConfigValidator() + config = ConfigValidator(help_text="The configuration for the monitor.") alert_rule = MonitorAlertRuleValidator(required=False) def validate_status(self, value):