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

add support of filter prop to swagger-ui-react #7547

Merged

Conversation

AndrewCeM
Copy link
Contributor

@AndrewCeM AndrewCeM commented Oct 8, 2021

Added possibility to pass filter prop to swagger-ui-react component, which allows filtering by tags.

Motivation and Context

swagger-ui-react doesn't support all implemented functionalities of the swagger-ui due to the fact that not all of the props are allowed to pass. I need a possibility to filter swagger docs by tags.
Fixes #7546

How Has This Been Tested?

I made fork of the swagger-ui and was testing it with applied changes on my local machine.

Screenshots (if appropriate):

image

My PR contains...

  • swagger-ui-react code change. filter prop was added to the propTypes and is passed to the swaggerUi as prop. It's set only once, on mount.
  • swagger-ui-react readme.md updated;
  • No code changes (src/ is unmodified: changes to documentation, CI, metadata, etc.)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)
  • Features (non-breaking change which adds functionality)

My changes...

  • are breaking changes to a public API (config options, System API, major UI change, etc).
  • are breaking changes to a private API (Redux, component props, utility functions, etc.).
  • are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).
  • are not breaking changes.

Documentation

  • My changes do not require a change to the project documentation.
  • My changes require a change to the project documentation.
  • If yes to above: I have updated the documentation accordingly.

Automated tests

  • My changes can not or do not need to be tested.
  • My changes can and should be tested by unit and/or integration tests.
  • If yes to above: I have added tests to cover my changes.
  • If yes to above: I have taken care to cover edge cases in my tests.
  • All new and existing tests passed.

# This is the 1st commit message:

add support of filter prop to swagger-ui-react

# This is the commit message swagger-api#2:

#`null` replaced with `false`
@AndrewCeM AndrewCeM force-pushed the add-filter-support-to-swagger-ui-react branch from 88284e8 to 408bc1d Compare October 8, 2021 11:08
@char0n char0n self-requested a review October 8, 2021 13:58
@char0n char0n self-assigned this Oct 8, 2021
Copy link
Member

@char0n char0n left a comment

Choose a reason for hiding this comment

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

@AndrewCeM thanks for contributing!

Please have a look at my code review comments before we move forward with the PR.

flavors/swagger-ui-react/index.jsx Outdated Show resolved Hide resolved
flavors/swagger-ui-react/README.md Outdated Show resolved Hide resolved
AndrewCeM and others added 2 commits October 11, 2021 16:33
Co-authored-by: Vladimir Gorej <vladimir.gorej@gmail.com>
Co-authored-by: Vladimir Gorej <vladimir.gorej@gmail.com>
@AndrewCeM AndrewCeM requested a review from char0n October 11, 2021 14:35
Copy link
Member

@char0n char0n left a comment

Choose a reason for hiding this comment

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

We're looking great here. Thank you for contributing.

We'll merge this as soon as v4 effort lands in master (probably next week).

https://swagger.io/blog/api-design/what%E2%80%99s-ahead-for-swaggerui-v4-and-swaggereditor-v4/

@char0n
Copy link
Member

char0n commented Oct 13, 2021

please build

@char0n
Copy link
Member

char0n commented Nov 8, 2021

please build

@char0n char0n merged commit b71446c into swagger-api:master Nov 8, 2021
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.

Add support of filter prop to swagger-ui-react component
3 participants