Skip to content

Commit ca46495

Browse files
grichaclaude
authored andcommitted
feat(api): Document issue/release/team params; mark legacy endpoints deprecated (#117874)
Surfaces real-but-undocumented params on three public endpoints so the generated OpenAPI schema matches what the handlers already accept, and marks two long-prose-deprecated endpoints with a machine-readable flag. Follow-up to #117843 — that PR added params via `@extend_schema`, but for these endpoints drf-spectacular can't surface them: the issue/release list schemas come from the hand-authored deprecated API docs, and the team `name` field was explicitly excluded. **Params documented** - **List a Project's Issues** — `sort` and `limit` (deprecated-docs JSON). `sort` omits the feature-flagged `recommended` value per review. - **List an Organization's Releases** — `project` and `per_page` (deprecated-docs JSON). - **Update a Team** — `name`. Already accepted via the serializer's `Meta.fields` but hidden by `exclude_fields`; now an explicit optional field. Runtime validation is unchanged — both callers (`TeamDetailsEndpoint.put`, SCIM `_rename_team_operation`) use partial updates. **Deprecation marked** (`deprecated: true`) - **List a Project's Issues** — superseded by the org-scoped issues endpoint. - **Submit User Feedback** — superseded by the User Feedback Widget. This is a soft-deprecation annotation only: no removal is planned and runtime behavior is unchanged. It makes the existing prose deprecation machine-readable so doc renderers and downstream consumers (e.g. Seer's code-mode typed API library, which derives its surface from this spec) can act on it. All changes are additive — no params removed, no types narrowed, no new required fields. `sentry django spectacular --validate --fail-on-warn` passes clean. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9fa05b2 commit ca46495

4 files changed

Lines changed: 46 additions & 2 deletions

File tree

api-docs/paths/events/project-issues.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"tags": ["Events"],
44
"description": "**Deprecated**: This endpoint has been replaced with the [Organization Issues endpoint](/api/events/list-an-organizations-issues/) which\nsupports filtering on project and additional functionality.\n\nReturn a list of issues (groups) bound to a project. All parameters are supplied as query string parameters. \n\n A default query of ``is:unresolved`` is applied. To return results with other statuses send an new query value (i.e. ``?query=`` for all results).\n\nThe ``statsPeriod`` parameter can be used to select the timeline stats which should be present. Possible values are: ``\"\"`` (disable),``\"24h\"`` (default), ``\"14d\"``\n\nUser feedback items from the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) are built off the issue platform, so to return a list of user feedback items for a specific project, filter for `issue.category:feedback`.",
55
"operationId": "List a Project's Issues",
6+
"deprecated": true,
67
"parameters": [
78
{
89
"name": "organization_id_or_slug",
@@ -54,6 +55,25 @@
5455
"type": "string"
5556
}
5657
},
58+
{
59+
"name": "sort",
60+
"in": "query",
61+
"description": "The sort order of the issues. Options include 'Last Seen' (`date`), 'First Seen' (`new`), 'Trends' (`trends`), 'Events' (`freq`), 'Users' (`user`), and 'Date Added' (`inbox`).",
62+
"schema": {
63+
"type": "string",
64+
"default": "date",
65+
"enum": ["date", "new", "trends", "freq", "user", "inbox"]
66+
}
67+
},
68+
{
69+
"name": "limit",
70+
"in": "query",
71+
"description": "The maximum number of issues to return. The maximum is 100.",
72+
"schema": {
73+
"type": "integer",
74+
"default": 100
75+
}
76+
},
5777
{
5878
"$ref": "../../components/parameters/pagination-cursor.json#/PaginationCursor"
5979
}

api-docs/paths/projects/user-feedback.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"tags": ["Projects"],
7474
"description": "*This endpoint is DEPRECATED. We document it here for older SDKs and users who are still migrating to the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) or [API](https://docs.sentry.io/platforms/javascript/user-feedback/#user-feedback-api)(multi-platform). If you are a new user, do not use this endpoint - unless you don't have a JS frontend, and your platform's SDK does not offer a feedback API.*\n\nFeedback must be received by the server no more than 30 minutes after the event was saved.\n\nAdditionally, within 5 minutes of submitting feedback it may also be overwritten. This is useful in situations where you may need to retry sending a request due to network failures.\n\nIf feedback is rejected due to a mutability threshold, a 409 status code will be returned.\n\nNote: Feedback may be submitted with DSN authentication (see auth documentation).",
7575
"operationId": "Submit User Feedback",
76+
"deprecated": true,
7677
"parameters": [
7778
{
7879
"name": "organization_id_or_slug",

api-docs/paths/releases/organization-releases.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@
2121
"type": "string"
2222
}
2323
},
24+
{
25+
"name": "project",
26+
"in": "query",
27+
"description": "The IDs or slugs of projects to filter releases by. This parameter may be repeated to filter by multiple projects. Omit to include all accessible projects; `-1` includes all accessible projects.",
28+
"schema": {
29+
"type": "array",
30+
"items": {
31+
"type": "string"
32+
}
33+
}
34+
},
35+
{
36+
"name": "per_page",
37+
"in": "query",
38+
"description": "The number of releases to return per page. Default and maximum allowed is 100.",
39+
"schema": {
40+
"type": "integer"
41+
}
42+
},
2443
{
2544
"$ref": "../../components/parameters/pagination-cursor.json#/PaginationCursor"
2645
}

src/sentry/core/endpoints/team_details.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from uuid import uuid4
22

33
from django.db import router, transaction
4-
from drf_spectacular.utils import extend_schema, extend_schema_serializer
4+
from drf_spectacular.utils import extend_schema
55
from rest_framework import serializers, status
66
from rest_framework.request import Request
77
from rest_framework.response import Response
@@ -34,8 +34,12 @@
3434
from sentry.models.team import Team, TeamStatus
3535

3636

37-
@extend_schema_serializer(exclude_fields=["name"])
3837
class TeamDetailsSerializer(CamelSnakeModelSerializer):
38+
name = serializers.CharField(
39+
max_length=64,
40+
required=False,
41+
help_text="The name of the team.",
42+
)
3943
slug = SentrySerializerSlugField(
4044
max_length=DEFAULT_SLUG_MAX_LENGTH,
4145
help_text="Uniquely identifies a team. This is must be available.",

0 commit comments

Comments
 (0)