-
Notifications
You must be signed in to change notification settings - Fork 27
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
CORS config TS types (both here and in @types) don't match the schema #49
Comments
Thanks for pointing out this issue @justingrant . I tried removing this |
Those types don't actually look correct:
|
I've also just come across this. In my case, I'm interested in the
(from https://www.serverless.com/blog/aws-http-api-support#configuring-cors). I notice that |
Hi @ed-graham, the Line 821 in bc84be8
The documentation you're referring to is for |
Thanks @fredericbarthelet - that's really helpful! I didn't realise I had the two things mixed up. It turns out that I was still using the old community-maintained Definitely Typed package rather than your new one: so now I've upgraded and everything is working as expected. |
I ran into serverless/serverless#9858 because the TS types don't have an accurate type for
HttpCors
.Here's the schema: https://github.com/serverless/serverless/blob/ef5a8faf13a8fbf8564e7c0621e88d1ea5357ea5/lib/plugins/aws/package/compile/events/apiGateway/index.js#L77-L98
The current type in this repo is essentially a no-op.
typescript/index.d.ts
Lines 190 to 199 in b700b72
The current type in
@types/serverless
is incomplete (missingorigin
andmethods
properties) and inaccurate (one oforigin
ororigins
is required, not optional, making it easy to run into serverless/serverless#9858). Also, all the optional properties have| undefined
appended which AFAIK is redundant and unnecessary.The actual types should be something like this:
or this
The text was updated successfully, but these errors were encountered: