-
Notifications
You must be signed in to change notification settings - Fork 34
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
Support for CloudEvents requests #350
Comments
Merged
Thanks for filing this issue! We now have a PR enabling custom body-parsing middleware: #353 Is this what you had in mind? |
Yes it is. Many thanks :) |
kraftp
added a commit
that referenced
this issue
Mar 21, 2024
PR adding support for custom body parsers through the `@KoaBodyParser` class decorator. If set, this overrides the default body parser for all endpoints in its class. Example: ```javascript @KoaBodyParser(bodyParser({ extendTypes: { json: ["application/json", "application/custom-content-type"], }, encoding: "utf-8" })) class TestEndpoints { ... } ``` Addresses issue #350
Fixed through the If you want to try it out now, install our preview build: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am working on an integration of a DBOS app with Dapr runtime. Dapr subpub building block transmits the message as a so called Envelope in the body of POST request with
Content-Type
header set toapplication/cloudevents+json"
(see 1).Currently the instantiated koa bodyparser in dbos-sdk, does not provide a way of extending allowed Content-Types, thus the body of HandlerContext.request.body is empty after it was parsed. In other words the DBOS endpoint can only work with request with a Content-Type listed here
Since the current version of dbos-ts relies heavily on http request to trigger a workflow, it would be important to provide more configuration for involved koa components such as bodyparser:
For instance in server.ts
Unfortunately I am not a TypeScript developer, otherwise, I would have contributed with a PR. :)
Thanks
The text was updated successfully, but these errors were encountered: