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

xml gen should follow json gen behavior #6555

Merged
merged 28 commits into from
Nov 3, 2020

Conversation

mathis-m
Copy link
Contributor

@mathis-m mathis-m commented Oct 23, 2020

Description

Merged the JSON and XML gen fns to be generic. And so the logic used is the same. This makes sense since generation does not differ to much.
Introduced exampleOverride so components do not need to care about overriding the schema.example.
Move plain js convert to fn.

Motivation and Context

This is part of #6470
Fixes #4943
Fixes #6540

How Has This Been Tested?

Unit tests have been modified.
Possibility to add unit tests for new override behavior.

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.

@mathis-m mathis-m marked this pull request as draft October 23, 2020 14:54
@mathis-m mathis-m marked this pull request as ready for review October 23, 2020 15:36
@tim-lai
Copy link
Contributor

tim-lai commented Oct 26, 2020

These might be related issues, and not fixed with this change:
#6540
#4943

@mathis-m
Copy link
Contributor Author

Thanks for the information, will trace this down.

@mathis-m
Copy link
Contributor Author

Fixes #6540 and #4943.

@tim-lai
Copy link
Contributor

tim-lai commented Oct 27, 2020

Thanks for looking at #6540 and #4943. Can you update this PR with tests referencing those two issues?

@mathis-m
Copy link
Contributor Author

Yes, I can add the tests accordingly!
In addition I will write detailed unit tests to test the sample generation function.

@mathis-m
Copy link
Contributor Author

Have added test for #4943 and #6540. Test for the fn.js should be covered with the original test/unit/core/plugins/samples/fn.js.
Shall the new overrideExample parameter be tested too?

@mathis-m
Copy link
Contributor Author

@tim-lai I think this is ready for a review!

@tim-lai tim-lai merged commit 288c89b into swagger-api:master Nov 3, 2020
@tim-lai
Copy link
Contributor

tim-lai commented Nov 3, 2020

@mathis-m Merged! Thanks for all the effort to this PR!

Pentusha pushed a commit to Pentusha/swagger-ui that referenced this pull request Nov 8, 2020
Jenkins Git plugin tagging with v3.36.2

* tag 'v3.36.2' of github.com:swagger-api/swagger-ui: (337 commits)
  chore(release): cut the v3.36.2 release
  fix: duplicate labels in Servers UI (swagger-api#6568)
  fix: externalDocs url for tags when using swagger v2.0 (swagger-api#6579)
  fix(schema example): xml gen should follow json gen behavior (swagger-api#6555)
  fix(cypress): oas3-request-body-required flakineess (swagger-api#6583)
  housekeeping(dev-deps): webpack-stats-plugin@1.0.2 (swagger-api#6576)
  chore: enforce commit message conventions (swagger-api#6577)
  chore(release): cut the v3.36.1 release
  housekeeping(deps): swagger-client@3.12.0 (swagger-api#6575)
  housekeeping(dev-deps): nightwatch@1.5.1
  fix(cypress): oas3-multiple-media-types flakiness (swagger-api#6571)
  housekeeping(dev-deps): file-loader@6.2.0
  housekeeping(dev-deps): mini-css-extract-plugin@1.2.1
  housekeeping(dev-deps): cypress@5.5.0
  ci(GA): add lint-errors step (swagger-api#6564)
  ci(GA): add test:artifact job (swagger-api#6562)
  ci(GA): add release job step (swagger-api#6558)
  ci(GA): use github actions as CI (swagger-api#6557)
  housekeeping(dev-deps): mini-css-extract-plugin@1.2.0
  housekeeping(dev-deps): @jest/globals@26.6.1
  ...
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.

XML example not rendered with oneOf, anyOf XML example not rendered correctly with oneOf
2 participants