Releases: swagger-api/swagger-js
Swagger-JS 3.0.16 Released!
Swagger-JS 3.0.15 Released!
Interface changes: None.
- README updates and improvements
- Configured the default resolver fetch implementation to send cookies and Authorization headers for same-origin requests (see #1083)
- Developer note: removed
package-lock.json
from the repository, as it was causing problems.
Swagger-JS 3.0.14 Released!
Interface changes: None.
- Fixed a defect in
__originalOperationId
logic (swagger-api/swagger-ui#3203) and added more tests around the functionality - Added throw when execute can't find a requested operation
Swagger-JS 3.0.12 Released!
Interface changes: New resolve options, see below.
- Improvement:
parameterMacro
andmodelPropertyMacro
options inresolve
(via #1067)
Swagger-JS 3.0.10 Released!
Interface changes: Client interface method names may differ if you have duplicate operationIds in your spec. Note that this is not a breaking change, as duplicate operationIds were previously undefined behavior.
Swagger-JS 3.0.9 Released!
Interface changes: no longer need to manually stringify request bodies for execute.
Swagger-JS 3.0.8 Released!
Swagger-JS 3.0.3 Released!
Interface changes: No runtime interface changes, but the bundle file is now exported as a UMD module.
- Added
loadSpec
option tofetch
that allows optimistic loading of a resource as text, regardless of responseContent-Type
- Added authorizations to instance
execute
- Fixed an issue where path and operation parameters weren't being merged (#965)
- Added
contextUrl
option that allows user to specify the URL that a spec is in the context of
Swagger-JS 3.0.2 Released!
Interface changes: None
- the
Access-Control-Allow-Origin: *
header is no longer attached to all requests
Swagger-JS 3.0.1 Released!
All new! The swagger-js project has been completely rewritten to clean up the code base as well as prepare for the upcoming OpenAPI Specification 3.0 (OAS 3.0).
Please note that the library does not currently support OAS 3.0 as it is still in draft form.
Expect an update to this library as we approach the release.
We have worked hard to improve the library without breaking too many plates along the way.
With progress comes change, though, and there are a number of changes that you need to carefully consider before upgrading to this version.
Depending on your programming techniques, the upgrade could have zero impact on your usage of the library.
Breaking changes
In releasing the 3.x series of swagger-js tooling, we have made extensive changes to how to interact with the library.
If you cannot support these changes, please remain on the 2.x series!
The changes are listed below.
-
You now must use node 6.x to build the swagger-js project. This is due to the standardization on ES6 syntax, among other things.
Note, newer versions may work fine, but the project is built and tested with 6.x. -
Minimum browser support: es5 compatible. IE11+ ( can probably make it run in IE10 )
-
Minimum runtime node version: 4.x
-
The constructor is similar, but there are some key differences.
- The return value is a promise. Not the client, the client is exposed as the only argument in the resolved promise.
- When the promise resolves, the specification has been downloaded and the api is ready to use.
- ie:
var promise = Swagger({...}).then(client => { ...} )
-
Swagger Specification
1.0
,1.1
,1.2
are no longer supported. Please remain on the 2.x series if you need to use older specification versions. -
Promise-only support. The older callback/error function signatures have been dropped to allow for a modern and consistent promise pattern.
- We've also dropped the
q
libraray in favour of the more standard approach of using native promises and a pollyfill where needed.
- We've also dropped the
-
Dropped all rendering logic. During the evolution of swagger-js, there was some rendering logic in the project for legacy support. Well that's gone now, and there is a clear separation of concerns between parsing & execution (swagger-js) and rendering (swagger-ui + others).
-
Dropped
asCurl
from library. This was considered to be part of rendering logic and removed with the reasoning above.
Major changes
-
Instantiation of swagger-js supports the 2.x series, with the exception that
usePromise
is implicitly (and always) true. -
New instantiation structure example:
Swagger({ ... }).then( client => { ... })
, whereclient
has all the goodies. -
Static functions, can do everything the methods can.
-
Code structure. There is now a clear separation between execution, resolution, and public interfaces.
-
Test structure, using http mocks instead of real nodejs servers. Much faster.
-
New build system, webpack + babel
More details...
Can be seen in Migration from 2.x.
Known limitations
There are some items which are limitations with the current release but are planned to be included to the library. Want them faster? Consider upvoting issues and being patient. Or even better, jump in and contribute!
-
Several internals to swagger-js 2.x ( see the the Graveyard.
-
Macro support
Global defaults for executing operations. Beyond the defaults described by the specification. Completely dropped -
Authentication. Limited support exists for try-it-out requests, none for the fetching of the OAS specs. This is a high priority and is being tracked in issues.