Releases: swagger-api/swagger-ui
Swagger-UI 3.0.4 Released!
Interface changes: StandalonePreset
no longer needs guarding logic for a default
property (see here).
- Fixed broken development server
- Added ability to disable validation badge by setting
validationUrl: null
- Scopes are displayed for oauth2 password flow
- Hid validation badge by default, when a spec is fetched from
localhost
- Cleaned up
package.json
Swagger-UI 3.0.3 Released!
Interface changes: No module interface changes, but the index.html
file for direct usage was moved.
- Added testing and linting.
- Moved
public/index.html
todist/index.html
. - Links in the Info section now open in a new window/tab.
- Removed logic that prevented Try-It-Out functionality if a
host
wasn't provided in the spec. - Added polyfills that fix issues in IE11 and lower.
- XML rendering fixes (#2766)
Swagger-UI 3.0.2 Released!
Interface changes: None.
- Disabled runtime YAML config option introduced in v3.0.0 that was causing issues.
- Added Docker support.
- Changed default: online validation badge now uses
online.swagger.io
validator if a validator URL isn't specified. - Fixed bug related to double-encoding of Try-It-Out responses (#2734)
- Added ability to provide
url
config via query parameter - Updated styling for error messages and PATCH/HEAD/OPTIONS operations
Swagger-UI 3.0.1 Released!
Swagger-UI 3.0.0 Released!
Version 3.0 brings a complete rewrite of Swagger-UI in React.js 🎉
What's new?
This version is a rewrite of Swagger-UI from the the ground up. You get the features in previous versions with benefits:
- Built using the latest technologies, based on React.js.
- Faster than before, handling larger files.
- Significantly easier to customize and extend.
- Fresh UI, giving the classic look a modern twist.
- Smaller overall size of the product.
- This version will also make it easier for us to support the next versions of the spec. This version of Swagger-UI supports version 2 of the Swagger Spec/OAS. Support for older versions have been dropped.
Known Issues
As a fresh rewrite, some features did not make it in, notably:
- Currently, the only configuration options available are the url and spec.
- The JSON Form Editor is not implemented.
- Shebang URL support for operations is missing.
- Support for collectionFormat is partial.
- l10n (translations) is not implemented.
- Relative path support for external files is not implemented.
Interface changes
Swagger-UI is still called with a single configuration object, but...
- the SwaggerUI function is no longer a constructor.
- you no longer need to assign the result of calling SwaggerUI to a global variable
- you no longer need to call the
.load()
method; UI will appear upon being called
To get started, take a look at how we're calling Swagger-UI in dist/index.html
and customize the config object to your needs.
Configuration via query parameter is still present as well. For example, you can load the Petstore by opening dist/index.html?url=http://petstore.swagger.io/v2/swagger.json
.
Distribution files & usage
Swagger-UI places four distribution files in its dist
folder, along with a sourcemap (.map
) for each file:
swagger-ui.js
: Swagger-UI's core code without any dependencies.swagger-ui.css
: Swagger-UI's styling.swagger-ui-bundle.js
: Swagger-UI's core code, with all dependencies included.swagger-ui-standalone-preset.js
: A preset that provides the default StandaloneLayout for Swagger-UI. You'll want to include this unless you're creating your own layout file.
There's also an index.html
file in the dist
folder that can be opened directly, if you want to quickly get started with using Swagger-UI.
Developing
Run npm run dev
to start a local dev server that will automatically hot reload any changes you make to Swagger-UI.
npm test
is available as well: it will run Swagger-UI's tests and linter.
In order to persist your changes into the dist
folder, npm run build
must be run.
If you're modifying to suit your needs, we suggest writing a plugin and/or a custom layout instead of modifying the core code (see below!).
Prerequisites
- Node 6.x
- NPM 3.x
Extending
You can create your own plugins that:
- provide custom pieces of state
- wrap existing state actions
- replace default components
You can also create your own layout that overrides the overall layout of components on the page.
Working with plugins and layouts will be easier if you're familiar with React. Most cases will be well-served by adding a plugin to src/plugins
and including it in the standalone preset.
More advanced use cases can bring their own build pipeline for their plugins and layouts, and use Swagger-UI as a library- Swagger-Editor does this!
Swagger-UI 2.2.8 Released!
Swagger-UI 2.2.7 Released!
Just in time for the holidays! An update to Swagger-UI, primarily focused on image downloading and rendering. Note! There are some limitations in Internet Explorer (all versions) for image downloading. Please follow #2525 for updates if this is giving you headaches. Heck, you can even contribute a fix!
Fixes:
Swagger-UI 2.2.6 Released!
If it 'aint fixed, broke it!
Minor fixes to address a couple regressions in v2.2.2-v2.2.5. Namely:
- Japanese messages updated #2437
- Chinese messages updated #2449
- Font src attribute fixed #2429
- File attachment blob download fixed #2439
From the swagger-js 2.1.23 update:
- Scheme selection broken for https swagger-api/swagger-js#871
- Fixed superagent send for
multipart/form-data
sending swagger-api/swagger-js#879 - Added support for custom http clients swagger-api/swagger-js#875
- Full vendor extensions now available in swagger-ui for customization swagger-api/swagger-js#869
Swagger-UI 2.2.5 Released!
Update to address a bug in swagger-js where schemes
are sometimes not honored.
Swagger-UI 2.2.4 Released!
Fixed an issue where query parameters without default values were being shown as undefined
.