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

Accept presets and defaultModelsExpandDepth props in swagger-ui-react component #5386

Conversation

tmkasun
Copy link
Contributor

@tmkasun tmkasun commented Jun 3, 2019

Improve the swagger-ui-react component configuration flexibility,

Description

This PR adds improvements to swagger-ui-react flavor, Allowing users to pass defaultModelsExpandDepth and presets parameters via React component properties. Other change is, adding default props for docExpansion, defaultModelsExpandDepth and preset parameters. Without the default props.

Motivation and Context

When using swagger-ui-react package with React 16.x , We wanted to remove the authorizeBtn from plugins, But it seems swagger-ui-react component doesn't accept presets nor plugins parameters.
Found this similar issue #5367 already raised.

And also I have added default props to newly added properties + the docExpansin property added from this #5242 PR. Without that, if the user didn't pass that prop, Swagger UI constructorConfig get undefined values ( even after the deep linking defaults + opts )

How Has This Been Tested?

Locally test the changes and run the npm test from swagger-ui local copy with the changes.

Screenshots (if appropriate):

Checklist

My PR contains...

  • 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.

…tion parameters as properties when initializing the Swagger-UI-react component
@tmkasun
Copy link
Contributor Author

tmkasun commented Jun 12, 2019

Hi @shockey,

Could you please review this PR and give your feedback.

@tmkasun
Copy link
Contributor Author

tmkasun commented Jul 17, 2019

Hi Maintainers,

Kind reminder on this PR

@tim-lai
Copy link
Contributor

tim-lai commented Jun 12, 2020

@tmkasun Thanks for the PR! Catching up on long standing requests... can you please rebase, fix merge conflicts, and add to documentation (flavors/swagger-ui-react/README.md)? Once done, should be ready to go!

@tim-lai tim-lai self-assigned this Jun 13, 2020
@tmkasun
Copy link
Contributor Author

tmkasun commented Jun 13, 2020

Hi @tim-lai,

Sure I will resolve the conflicts, Update the Docs and ping you

Thanks
~Kasun

@iamanoopmk
Copy link

Any update on this please?

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