Skip to content

Commit 87f1a97

Browse files
authored
Merge branch 'master' into ft/react-perf-permanent
2 parents c1f3703 + e43c450 commit 87f1a97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2890
-158
lines changed

.github/issue_template.md

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,63 @@
1-
When reporting an issue, please provide the following details:
2-
- swagger-ui version
3-
- a swagger file reproducing the issue
1+
<!---
2+
Thanks for filing an issue 😄 ! Before you submit, please read the following:
3+
4+
Search open/closed issues before submitting since someone might have asked the same thing before!
5+
6+
Issues on GitHub are only related to problems of Swagger-UI itself. We'll try to offer support
7+
here for your use case, but we can't offer help with projects that use Swagger-UI indirectly,
8+
like Springfox or swagger-node.
9+
10+
Likewise, we can't accept features or bugs in the Swagger/OpenAPI specifications themselves,
11+
or anything that violates the specifications.
12+
13+
-->
14+
15+
<!--- Provide a general summary of the issue in the title above -->
16+
17+
18+
| Q | A
19+
| ------------------------------- | -------
20+
| Bug or feature request? |
21+
| Which Swagger/OpenAPI version? |
22+
| Which Swagger-UI version? |
23+
| How did you install Swagger-UI? |
24+
| Which broswer & version? |
25+
| Which operating system? |
26+
27+
28+
### Demonstration API definition
29+
<!--- If you're describing a bug, please provide an API definition that reproduces your problem -->
30+
<!--- If you have link to a demo repo please link that! -->
31+
32+
<!--- If your spec is large, please put it into a Gist (https://gist.github.com) instead of pasting it here. -->
33+
34+
```yaml
35+
your: "API definition goes here"
36+
```
37+
38+
### Configuration (browser query string, constructor, config.yaml)
39+
<!--- If describing a bug, tell us what your configuration looks like -->
40+
41+
```js
42+
{
43+
"your": { "constructorConfig": "here" }
44+
}
45+
```
46+
47+
`?yourQueryStringConfig=here`
48+
49+
### Expected Behavior
50+
<!--- If you're describing a bug, tell us what should happen -->
51+
<!--- If you're suggesting a change/improvement, tell us how it should work -->
52+
53+
### Current Behavior
54+
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
55+
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
56+
57+
### Possible Solution
58+
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
59+
<!--- or ideas how to implement the addition or change -->
60+
61+
### Context
62+
<!--- How has this issue affected you? What are you trying to accomplish? -->
63+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ npm-debug.log*
66
.eslintcache
77
package-lock.json
88
*.iml
9+
selenium-debug.log
10+
test/e2e/db.json

CONTRIBUTING.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
## Contributing to Swagger-UI
2+
3+
We love contributions from our community of users! This document explains our guidelines and workflows. Please take care to follow them, as it helps us keep things moving smoothly.
4+
5+
#### Environment setup
6+
7+
0. Install Node.js (4 or newer) and npm (3 or newer).
8+
1. Make a fork of Swagger-UI on GitHub, then clone your fork to your machine.
9+
2. Run `npm install` in your Swagger-UI directory.
10+
3. Run `npm run dev`. `localhost:3200` should open automatically.
11+
4. You're ready to go!
12+
13+
#### Branching model
14+
15+
Feature branches should be prefixed with `ft/`.
16+
17+
Bugfix branches should be prefixed with `bug/`.
18+
19+
Version branches should be prefixed with `v/`.
20+
21+
After the forward slash, include a short description of what you're fixing. For example: `bug/fix-everything-that-was-broken`. For versions, add the version that will be released via the branch, for example: `v/1.2.3`.
22+
23+
If there's an issue filed that you're addressing in your branch, include the issue number directly after the forward slash. For example: `bug/1234-fix-all-the-other-things`.
24+
25+
#### Filing issues
26+
27+
- **Do** include the Swagger-UI build you're using - you can find this by opening your console and checking `window.versions.swaggerUi`
28+
- **Do** include a spec that demonstrates the issue you're experiencing.
29+
- **Do** include screenshots, if needed. GIFs are even better!
30+
- **Do** place code inside of a pre-formatted container by surrounding the code with triple backticks.
31+
- **Don't** open tickets discussing issues with the Swagger/OpenAPI specification itself, or for issues with projects that use Swagger-UI.
32+
- **Don't** open an issue without searching the issue tracker for duplicates first.
33+
34+
#### Committing
35+
36+
- Break your commits into logical atomic units. Well-segmented commits make it _much_ easier for others to step through your changes.
37+
- Limit your subject (first) line to 50 characters (GitHub truncates more than 70).
38+
- Provide a body if you'd like to explain your commit in detail.
39+
- Capitalize the beginning of your subject line, and do not end the subject line with a period.
40+
- Your subject line should complete this sentence: `If applied, this commit will [your subject line].`
41+
- Don't use [magic GitHub words](https://help.github.com/articles/closing-issues-using-keywords/) in your commits to close issues - do that in the pull request for your code instead.
42+
43+
_Adapted from [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/#seven-rules)._
44+
45+
#### Making pull requests
46+
47+
- **Do** summarize your changes in the PR body. If in doubt, write a bullet-point list titled `This PR does the following:`.
48+
- **Do** include references to issues that your PR solves, and use [magic GitHub words](https://help.github.com/articles/closing-issues-using-keywords/) to close those issues automatically when your PR is merged.
49+
- **Do** include tests that cover new or changed functionality.
50+
- **Do** be careful to follow our ESLint style rules. We recommend installing an ESLint plugin if you use a graphical code editor.
51+
- **Do** make sure that tests and the linter are passing by running `npm test` locally, otherwise we can't merge your pull request.
52+
- **Don't** include any changes to files in the `dist/` directory - we update those files only during releases.
53+
- **Don't** mention maintainers in your original PR body - we probably would've seen it anyway, so it just increases the noise in our inboxes. Do feel free to ping maintainers if a week has passed and you've heard nothing from us.
54+
- **Don't** open PRs for custom functionality that only serves a small subset of our users - custom functionality should be implemented outside of our codebase, via a plugin.

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The OpenAPI Specification has undergone 5 revisions since initial creation in 20
2222

2323
Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes
2424
------------------ | ------------ | -------------------------- | -----
25-
3.1.2 | 2017-07-31 | 2.0, 3.0 | [tag v3.1.2](https://github.com/swagger-api/swagger-ui/tree/v3.1.2)
25+
3.1.4 | 2017-08-05 | 2.0, 3.0 | [tag v3.1.4](https://github.com/swagger-api/swagger-ui/tree/v3.1.4)
2626
3.0.21 | 2017-07-26 | 2.0 | [tag v3.0.21](https://github.com/swagger-api/swagger-ui/tree/v3.0.21)
2727
2.2.10 | 2017-01-04 | 1.1, 1.2, 2.0 | [tag v2.2.10](https://github.com/swagger-api/swagger-ui/tree/v2.2.10)
2828
2.1.5 | 2016-07-20 | 1.1, 1.2, 2.0 | [tag v2.1.5](https://github.com/swagger-api/swagger-ui/tree/v2.1.5)
@@ -59,6 +59,15 @@ If you'd like to make modifications to the codebase, run the dev server with: `n
5959

6060
If you'd like to rebuild the `/dist` folder with your codebase changes, run `npm run build`.
6161

62+
63+
##### Integration Tests
64+
65+
You will need JDK of version 7 or higher as instructed here
66+
http://nightwatchjs.org/gettingstarted#selenium-server-setup
67+
68+
Integration tests can be run locally with `npm run e2e` - be sure you aren't running a dev server when testing!
69+
70+
6271
##### Browser support
6372
Swagger UI works in the latest versions of Chrome, Safari, Firefox, Edge and IE11.
6473

@@ -97,7 +106,7 @@ To use swagger-ui's bundles, you should take a look at the [source of swagger-ui
97106

98107
#### OAuth2 configuration
99108
You can configure OAuth2 authorization by calling `initOAuth` method with passed configs under the instance of `SwaggerUIBundle`
100-
default `client_id` and `client_secret`, `realm`, an application name `appName`, `scopeSeparator`, `additionalQueryStringParams`,
109+
default `client_id` and `client_secret`, `realm`, an application name `appName`, `scopeSeparator`, `additionalQueryStringParams`,
101110
`useBasicAuthenticationWithAccessCodeGrant`.
102111

103112
Config Name | Description
@@ -108,7 +117,7 @@ realm | realm query parameter (for oauth1) added to `authorizationUrl` and `toke
108117
appName | application name, displayed in authorization popup. MUST be a string
109118
scopeSeparator | scope separator for passing scopes, encoded before calling, default value is a space (encoded value `%20`). MUST be a string
110119
additionalQueryStringParams | Additional query parameters added to `authorizationUrl` and `tokenUrl`. MUST be an object
111-
useBasicAuthenticationWithAccessCodeGrant | Only activated for the `accessCode` flow. During the `authorization_code` request to the `tokenUrl`, pass the [Client Password](https://tools.ietf.org/html/rfc6749#section-2.3.1) using the HTTP Basic Authentication scheme (`Authorization` header with `Basic base64encoded[client_id:client_secret]`). The default is `false`
120+
useBasicAuthenticationWithAccessCodeGrant | Only activated for the `accessCode` flow. During the `authorization_code` request to the `tokenUrl`, pass the [Client Password](https://tools.ietf.org/html/rfc6749#section-2.3.1) using the HTTP Basic Authentication scheme (`Authorization` header with `Basic base64encoded[client_id:client_secret]`). The default is `false`
112121

113122
```
114123
const ui = SwaggerUIBundle({...})

dev-helpers/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
{
2222
box-sizing: inherit;
2323
}
24-
2524
body {
2625
margin:0;
2726
background: #fafafa;

dist/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
<style>
1212
html
1313
{
14-
box-sizing: border-box;
15-
overflow: -moz-scrollbars-vertical;
16-
overflow-y: scroll;
14+
box-sizing: border-box;
15+
overflow: -moz-scrollbars-vertical;
16+
overflow-y: scroll;
1717
}
1818
*,
1919
*:before,
2020
*:after
2121
{
22-
box-sizing: inherit;
22+
box-sizing: inherit;
2323
}
2424

2525
body {

dist/swagger-ui-bundle.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui-bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)