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

feat: add callbacks support #1224

Merged
merged 37 commits into from
Apr 8, 2020
Merged

feat: add callbacks support #1224

merged 37 commits into from
Apr 8, 2020

Conversation

lesyk-lesyk
Copy link

@lesyk-lesyk lesyk-lesyk commented Apr 2, 2020

This PR utilizes the code from #1102 written by @Jonathan-Bailey-Bose and #757 written by @Makashov to add callback support to ReDoc.

  • Updated layout for Callbacks middle section:

    • Callbacks by default will use the operation summary (or description, if summary does not exist) when rendered by ReDoc instead of callback name
    • Added method budge (POST / PUT / etc.) for callback summary
    • Added Deprecated label for deprecated callbacks (with strikeout callback summary)
      image
  • Created new component for visualizing Callback details

    • Show description in Callback details
    • Move Endpoint component from the right panel to Callback details (added compact property for Endpoint component for displaying smaller HTTP method verb)
      image
  • By default, the callbacks do not use top-level Servers
    image

  • But servers can be defined

    • on the path level
      image
    • or operation level
      image
  • Added one more dropdown for switching callback request examples (with truncating long names with an ellipsis). Created a "GenericChildrenSwitcher" component that tracks the selected item itself.
    image

  • Added new endpoint /store/subscribe and few callbacks in openapi.yaml demo file with different configs to illustrate all possible configurations for callbacks.

  • Also, in the scope of this PR was updated styles for the label in the dropdown for consistency and added gray colors to the theme.


All together:

image

Copy link
Member

@RomanHotsiy RomanHotsiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general.

I left a few minor comments.

Also,

  • could you make color of this shevron not so dark?
    image
  • rename Callback request samples to Callback payload samples

src/components/CallbackSamples/CallbackReqSamples.tsx Outdated Show resolved Hide resolved
src/components/CallbackSamples/CallbackSamples.tsx Outdated Show resolved Hide resolved
src/components/Callbacks/CallbackDetails.tsx Outdated Show resolved Hide resolved
src/components/GenericDropdown/GenericDropdown.tsx Outdated Show resolved Hide resolved
src/components/Responses/ResponsesList.tsx Show resolved Hide resolved
@RomanHotsiy RomanHotsiy changed the title [Feature] Add Callbacks support feat: add callbacks support Apr 8, 2020
@RomanHotsiy RomanHotsiy merged commit 57e93ec into Redocly:master Apr 8, 2020
@RomanHotsiy
Copy link
Member

🎉

Thanks @Jonathan-Bailey-Bose and @Makashov for initial implementation!

Kudos to @okachynskyy for finishing it up 👏 🔥!

I will publish a new release at the end of the week.

@lesyk-lesyk lesyk-lesyk deleted the feat/callbacks-support branch April 8, 2020 11:13
@RomanHotsiy
Copy link
Member

Released in 2.0.0-rc.27

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

Successfully merging this pull request may close these issues.

3 participants