Repository navigation
Conversation
…129568) ### Why? Five unpublished methods declare responses or request bodies that drf-spectacular can't describe. The published build skips unpublished methods, so nothing has caught them. A build that describes every method does: the csrf endpoint makes its spec invalid, and the other four come out wrong or untyped. This is split out of the internal-spec PR below, which needs it first, so each endpoint's owners can review their change on its own. - #129559 ### How? Each declaration now keys responses by status code and describes TypedDicts through an inline response serializer, as published endpoints do. The SCIM replace body gets its own component name. The published spec is byte-identical. <sub>Generated with Claude Code</sub>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c781b98. Configure here.
The published spec describes only published methods, so it can't serve as a contract for the private and experimental endpoints the frontend calls. sentry.apidocs.internal builds one that does, reading undeclared responses from Response[T] annotations and omitting nothing. Its generator switches this on for its own build through hook parameters and a type-hint policy whose defaults are the published build's, so the published spec is unchanged. Extracted from the internal-spec half of #129315.
Consumers that filter operations by the permissions guarding them need the class names, which only the view classes have. Each operation the internal build admits now carries its view's permission_classes as x-sentry-permissions, with ones composed by &, | and ~ unwrapped to the classes they compose.
c781b98 to
ba526f9
Compare
…s view DRF's ViewInspector.__set__ binds an assigned schema to the view instance, the same way drf-spectacular's create_view swaps in @extend_schema classes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue endpoints declare IssueParams.ISSUES_OR_GROUPS, a `var` path
parameter for the published build's `{var}` spelling of (?:issues|groups),
which the published postprocessing drops along with the `{var}`. The
internal build spells the path `issues/` and kept the parameter, so 16
issue operations declared a required `var` that is not in their path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ations drf-spectacular appends APPEND_PATHS over whole path items, so a hand-written path item dropped every method its view serves that the item does not describe. The published build only describes the hand-written ones anyway; the internal one dropped POST on organization sentry-app-installations. The internal build now appends them method by method, hand-written still winning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re Bugbot's Replacement schema drops view binding (resolved): False positive: the binding happens on assignment. DRF's
|
…nd-written one
The published build appends APPEND_PATHS, then _fix_issue_paths moves the
generated issue operations onto the hand-written paths, so the published
reference describes GET issues/{issue_id}/tags/{key}/values/ with its
generated operation. The internal build spells that path issues/ up front,
and the hand-written operation won instead, with another operationId,
parameters and response schema. A published method's generated operation
now wins here too; hand-written ones still stand in for the rest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| def _in_reference(operation: Mapping[str, Any]) -> bool: | ||
| return True |
There was a problem hiding this comment.
What's the point of this function if it always returns true?
There was a problem hiding this comment.
None: it was only the published build's default for in_reference, and _public_spelling (identity, the default for public_path) was the same. 1aa8b71 removes both and defaults those parameters to None, so only the internal build passes them. The published build behaves the same as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Internal spec compared with master's published specBuilt from this branch at cf75375 (master merged in) and from master at cce6621. With master merged in, this branch's own published build is byte-identical to master's. Every one of the 273 operations in master's published spec is in the internal spec. Comparing each pair with
The internal spec also describes 680 operations master's published spec doesn't (540 private, 140 experimental). ExamplesEach diff is master's published spec ( Update an organization:
|
`_in_reference` always returned True and `_public_spelling` returned its argument; each existed only as the published build's default. Default `in_reference` and `public_path` to None instead, which leaves the published build's behavior unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Build an internal-use only OpenAPI spec of all endpoints (incl private and experimental endpoints). This will be used by our frontend as well as Seer code mode.
Slop
Why?
The published OpenAPI spec only describes published endpoint methods, so it can't serve as a contract for the private and experimental endpoints the frontend calls. The PR below builds an internal spec for that, but switches it on with an environment flag checked throughout the shared apidocs code. This pulls that build out on its own, so the published build never runs any of it.
Depends on the PR below, which fixes schema declarations on unpublished endpoints. Until it lands,
make build-internal-api-docsfails--validateon the csrf endpoint.How?
make build-internal-api-docsruns drf-spectacular withsentry.apidocs.internal.InternalGenerator. It switches the internal behavior on for its own build only, through keyword parameters on the shared hooks and a type-hint policy whose defaults are the published build's, so the published spec is byte-identical. The internal build describes every method with its publish status and permission classes, reads undeclared responses fromResponse[T]annotations, and closes TypedDicts.Decisions
streamlineOnly. With nothing omitted, the build skips the omission check's second build. Deprecation markers are kept.x-sentry-permissionslists the classes in the view'spermission_classes, with composed ones (A & B,~A) unwrapped, for consumers that filter operations by how they're guarded.Generated with Claude Code