novuhq / novu

Open-Source Notification Platform. Embeddable Notification Center, E-mail, Push and Slack Integrations.
https://novu.co
Other
34.47k stars 3.51k forks source link

🐛 Bug Report: Layout API Interface contract is not correct for listing #4020

Open ryshu opened 1 year ago

ryshu commented 1 year ago

📜 Description

The Layout API interface contract is not correct, it states that the "page" field is optional but not providing it causes a 500 error.

See https://github.com/novuhq/novu-python/issues/47 for more details

👟 Reproduction steps

import requests

res = requests.get(url=f"{layout_client._layout_url}", headers={"Authorization": f"Bearer {token}"})
res.raise_for_status()
print("OK")

👍 Expected behavior

python bug.py
>>> OK

👎 Actual Behavior with Screenshots

python bug.py
>>> requests.exceptions.HTTPError: 500 Server Error: Internal Server Error

Novu version

Novu SaaS

npm version

N/A

node version

N/A

📃 Provide any additional context for the Bug.

N/A

👀 Have you spent some time to check if this bug has been raised before?

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

None

balogun14 commented 11 months ago

@ryshu can you explain this a bit more

ryshu commented 11 months ago

@balogun14 Sry for the delay

The API require you to provide path params. If you don't provide them, it will make the server crash in a 500 Interne Server Error.

Think here we need to fix:

https://docs.novu.co/api-reference/layouts/filter-layouts

balogun14 commented 11 months ago

@ryshu i will see if I can fix it