Skip to content

Commit f53b43c

Browse files
feat(api): troubleshooting tests for publishing
1 parent 27d09c2 commit f53b43c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

develop-docs/backend/api/public.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,23 @@ and add the `Component: API` label.
423423
The team responsible for the endpoint will review the stability of the endpoint. If the endpoint
424424
will not have breaking changes in future, they can determine whether to make it public.
425425

426+
### Test Troubleshooting
427+
*Problem*: `TypeError: Cannot read properties of null (reading 'type')`
428+
If you have a `ChoiceField` that can be null, make sure you're using the right option. `allow_blank` should be used for textual choices, while `allow_null` should be used for numeric and other non-textual choices.
429+
430+
*Problem*: `must have required property '<property>'`
431+
Your example response is missing one of the required properties specified by the response class. The property should either be made optional or you should add it to the example.
432+
433+
*Problem*: `must NOT have additional properties`
434+
Your example response includes a property not included in the response class. This either needs to be added to the response class or removed from the example. s
435+
436+
*Problem*: `must be <type>`
437+
The type of the value for a property in your example response does not match the type for the property specified by the response class. The example value or the type of the property in the response class should be fixed.
438+
439+
*Problem*: `sentry.apidocs.utils.SentryApiBuildError: projects is not defined by OPENAPI_TAGS in src/sentry/apidocs/build.py for <endpoint title>`
440+
You need to add the endpoint to a section of the API docs with the `@extend_schema(tags=['<section title>'])`. Section tags live at [`src/sentry/apidocs/build.py`](https://github.com/getsentry/sentry/blob/isabella/proj-env-details/src/sentry/apidocs/build.py).
441+
442+
426443
### FAQs
427444

428445
**When should an attribute be `required`?**

0 commit comments

Comments
 (0)