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

Switch read-only and write-only behaviour in callbacks and webhooks #727

Closed
gherkz opened this issue Apr 21, 2022 · 2 comments
Closed

Switch read-only and write-only behaviour in callbacks and webhooks #727

gherkz opened this issue Apr 21, 2022 · 2 comments

Comments

@gherkz
Copy link

gherkz commented Apr 21, 2022

Currently, RapiDoc hides read-only fields in requests and hides write-only fields in responses.

However, this behavior is the wrong way round for callbacks and webhooks, since the request is a "read" and the response is a "write". An obvious example of how this is the wrong way round would be an object with an ID field getting POSTed to a webhook:

{
    "id": 123,
    ...
}

Under the current behaviour, the ID field is hidden in the docs for requests that gets sent to a webhook or callback. Of course we would actually send the ID field.

Redoc had the same issue: Redocly/redoc#1720. It looks like they solved it by correcting the behavior and adding a new setting to switch back to the old behavior if desired.

If you can think of any workarounds for this in the meantime, then please do share! Looking to add a webhook to my API, and would prefer not to have an awkward comment in the description that says "the ID will be there, even though the docs don't mention it" 😄

PS - Related Issue swagger-api/swagger-ui#6294

@mrin9
Copy link
Collaborator

mrin9 commented May 16, 2022

closed by 375935e

Thanks for the PR @gherkz

@mrin9 mrin9 closed this as completed May 16, 2022
@gherkz
Copy link
Author

gherkz commented May 16, 2022

No problem. IMO, rapidoc is the best solution out there over redoc and swagger UI - keep up the great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants