Skip to content

Conversation

@iamrajjoshi
Copy link
Contributor

some Sentry endpoints don't have any parameters, neither path nor query. An example would be DocIntegrationsEndpoint

currently our Open API Resolver makes the assumption that there will always be parameters, so when trying to document parameter-less endpoints, we see the following error:

Error: Cannot read properties of undefined (reading 'filter')

 summary: apiData.summary,
  130 |           descriptionMarkdown: apiData.description,
> 131 |           pathParameters: apiData.parameters.filter(
      |                                              ^
  132 |             p => p.in === 'path'
  133 |           ) as APIParameter[],
  134 |           queryParameters: apiData.parameters.filter(

in this pr, i update the type of parameters to union with undefined to reflect that it might not exist and handle that case when building the api categories for documentation.

API documentation without the parameter will now look something like:
image

@iamrajjoshi iamrajjoshi self-assigned this Nov 9, 2024
@vercel
Copy link

vercel bot commented Nov 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
changelog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 5:13am
develop-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 5:13am
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 5:13am

@iamrajjoshi iamrajjoshi merged commit b8e7ffd into master Nov 11, 2024
13 checks passed
@iamrajjoshi iamrajjoshi deleted the raj/fix-open-api-resolver-for-no-params branch November 11, 2024 16:19
vaind pushed a commit that referenced this pull request Nov 11, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants