asyncapi / glee

Glee β€” The AsyncAPI framework that will make you smile again :)
87 stars 61 forks source link

Glee crashes when body is not proper json in http request #476

Open KhudaDad414 opened 1 year ago

KhudaDad414 commented 1 year ago

Reason/Context

If the the request body does not contain proper json as glee expects, it will crush with the following error:

Screenshot 2023-07-10 at 17 13 00

Expected behaviour

1) check if user's HTTP request is documented in AsyncAPI file, if it is not, then show proper message on server console and send a 404 error to the client.

2) Glee should show a proper message instead of crushing if proper json is not passed to by the client.

SrijanShovit commented 1 year ago

Hi @KhudaDad414 I would like to take up this issue. Right now I am trying to setup things. Thanks!!

KhudaDad414 commented 1 year ago

@SrijanShovit go ahead mate. just let me know if you needed some help. πŸ˜„

SrijanShovit commented 1 year ago

Hey I tried setting up, but got confused how to run the projectπŸ˜…

Souvikns commented 1 year ago

@SrijanShovit to run the project:

I hope this helps, if it does not feel free to share which step you are stuck with.

SrijanShovit commented 1 year ago

Hi @KhudaDad414 @Souvikns , I tried to run the project as per the steps told above,but got the following error:

async api

I tried understanding about the error, but as I am new , I couldn't. Could you please guide about it and also may I have an overview of flow or architecture of this project? Thanks!!

KhudaDad414 commented 1 year ago

@SrijanShovit the error should be gone now. please delete you .glee folder and update your glee to the latest version. after that run npm run dev and it should be fine.

peter-rr commented 1 year ago

@KhudaDad414 @SrijanShovit Working fine for me after following those steps πŸ‘ (Glee version tested: 0.26.0)

Souvikns commented 11 months ago

Is anyone working on this, should we put this issue for hacktoberfest?

AnishKacham commented 11 months ago

Hi. I can work on this if no one's assigned πŸ˜…

KhudaDad414 commented 10 months ago

Hi @AnishKacham, you can start working on the issue. please let me know if you need some help.

Gmin2 commented 8 months ago

working on this when i try to run the http-test example it is generating this error,localhost:3000 is not spinning up image

cc @KhudaDad414 @Souvikns

Gmin2 commented 8 months ago

@SrijanShovit to run the project:

I hope this helps, if it does not feel free to share which step you are stuck with.

Followed this guide for it

cc @KhudaDad414 @Souvikns

KhudaDad414 commented 7 months ago

@Min2who the issue has been resolved. please try with the latest version.

Gmin2 commented 7 months ago

@Min2who the issue has been resolved. please try with the latest version.

It is giving this error now

image

peter-rr commented 5 months ago

It is giving this error now

Still getting the same error. Seems like there is some conflict at sendTrigger operation when parsing the spec file πŸ€”

image

Glee version tested: 0.36.14

cc @KhudaDad414 @Souvikns

KhudaDad414 commented 5 months ago

@peter-rr your AsyncAPI file is not valid. As it should have been said in the error, messages in operation should point to messages in their respective channels. sendTrigger/messages should be something like:

messages:
  - $ref: "#/channels/TRIGGER/messages/string"

@utnim2 I don't see your asyncapi file but I think your issue is the same.

peter-rr commented 5 months ago

@KhudaDad414 Great! Let me change the sendTrigger/messages then πŸ‘ I guess the asyncapi file @utnim2 has been using is the following one: https://github.com/asyncapi/glee/blob/ed66e843ea1305a5823f7e4bd98503b57dd72607/examples/http-test/asyncapi.yaml#L49

peter-rr commented 5 months ago

@KhudaDad414 Working correctly now after changing the operation messages as you mentioned above. I've opened a PR to fix that issue: https://github.com/asyncapi/glee/pull/805

KhudaDad414 commented 5 months ago

@peter-rr merged.

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart: