A Swagger specification package is composed of two files:
yaml
file containing the Swagger 2.0 specificationThe package.json file is a mandatory file to define the content of an NPM package
.
The file should contain at least the following fields:
The Swagger 2.0 specification generated by the Swagger Builder.
Even if the tool supports a generation to a split spec, we strongly recommend using a yaml
format to expose the specification in a package.
The package.json
file can be automatically generated by the Swagger Builder by using the --artifact
option (or via the artifact field of the configuration file).
When requested, the package.json
file will be generated in the same folder of the resultant Swagger specifications. The Swagger specification version number will be applied to the version
field.
[!TIP] The version can be manually specified via the
--set-version
command
By default, a field license
will be added to the package.json
with the value BSD-3-Clause.