Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript/TypeScript SDK type issues #1451

Open
mderriey opened this issue Sep 25, 2024 · 2 comments
Open

JavaScript/TypeScript SDK type issues #1451

mderriey opened this issue Sep 25, 2024 · 2 comments
Labels
grooming lib/javascript JavaScript client library

Comments

@mderriey
Copy link

Originally posted on Slack at https://svixcommunity.slack.com/archives/C022BJ2EBHV/p1727206631611579

Bug Report

Version

svix npm package v1.34.0.

Platform

N/A

Description

We're using the svix npm package to interact with the API and we found a case where the TypeScript types are incorrect.

The Svix.endpoint.patch function takes an EndpointPatch argument typed as follows:

export class EndpointPatch {
  // Most properties omitted for brevity
  'channels'?: Array<string>;
  'filterTypes'?: Array<string>;
}

These two properties do not allow null, although the API does accept null values for these properties as per https://api.svix.com/docs#tag/Endpoint/operation/v1.endpoint.patch, meaning we've had to use an as type assertion to avoid a TypeScript error.

Any chance we can see if openapi-generator can correctly type those?
All properties in this type are marked as nullable so I suspect it's an openapi-generator config we may be missing.

Thanks in advance!

@tasn tasn added lib/javascript JavaScript client library grooming labels Sep 26, 2024
@tasn
Copy link
Member

tasn commented Sep 26, 2024

Thanks for reporting!

@tasn
Copy link
Member

tasn commented Oct 23, 2024

I think it may be fixed by #1480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grooming lib/javascript JavaScript client library
Projects
None yet
Development

No branches or pull requests

2 participants