Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
swagger-bundler
Readme
This is individual tool for bundling swagger definitions.
::
$ pip install "swagger-bundler[validation]"
or
::
$ pip install -e git+git@github.com:podhmo/swagger-bundler.git@master#egg=swagger_bundler
generating your config file
using it
generating your config file ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
swagger-bundler needs config file for using. so, at first, you must generate config file.
::
$ swagger-bundler config --init generate ~/venv/web/work/swagger-bundler.ini.
The stragegy of finding config file, following below.
Your current working directory is ~/venv/web/work/
. then,
~/venv/web/work/swagger-bundler.ini
~/venv/web/swagger-bundler.ini
~/venv/swagger-bundler.ini
~/swagger-bundler.ini
Config file is not found, then, lookup ~/.swagger-bundle.ini
.
.. code-block::
Usage: swagger-bundler [OPTIONS] COMMAND [ARGS]...
Options: --help Show this message and exit.
Commands: bundle bundles many source files into single file concat concatnates many swagger-definition files config show config validate validates via swagger-2.0 spec
Swagger-bundler has two commands.
bundle
This is the main feature. bundling many source files into one single swagger-definition file.
::
$ swagger-bundler bundle <file.yaml>
The target file of swagger-bundler, it can use three special-marker.
- x-bundler-namespace -- when bundling, using this value as prefix string.
- x-bundler-compose -- importing from other files with namespace
- x-bundler-concat -- importing from other files **without namespace**
For example. the structure of current working directory is such as below,
::
.
├── main.yaml
└── parts
├── common.yaml
├── x.yaml
└── y.yaml
and the content of main.yaml is this.
.. code-block:: yaml
x-bundler-namespace: ZZZ
x-bundler-compose:
- ./parts/x.yaml
- ./parts/y.yaml
x-bundler-concat:
- ./parts/common.yaml
And run it.
.. code-block:: bash
$ swagger-bundler bundle main.yaml
- definitions in x.yaml, y.yaml are renamed (with namespace). (e.g. foo -> ZZZFoo)
- definitions in common.yaml are not renamed. (e.g. bar -> bar)
The link of `example <example.rst>`_.
qualified import.
.. code-block:: yaml
x-bundler-namespace: O
x-bundler-compose:
- ../parts/x-state.yaml as X
- ../parts/y-state.yaml as Y
then
- state of x-state.yaml is converting XState, eventually, OXState
- state of y-state.yaml is converting YState, eventually, OYState
the link of `example(qualified import) <example2.rst>`_
concat
This is just concatnate files.
::
$ swagger-bundler concat [file1.yaml] [file2.yaml] ...
hook
configuration.watch
option is supported.hook configuration ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Hook configuration examples.
lifting sub definitions sample <example3.rst>
_tiny individual mixin sample <example4.rst>
_deref sample <example5.rst>
_watch option ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
$ pip install "swagger-bundler[watch]" $ swagger-bundler bundle --watch "*.yaml" --outfile="/tmp/output.yaml" src.yaml
0.1.10.4
0.1.10.1
0.1.10
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1
0.0.7
0.0.6
0.0.5
0.0.4
--namespace
option0.0.3
FAQs
swagger schema bundler
We found that swagger-bundler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.