Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
apispec-webframeworks
Advanced tools
apispec-webframeworks
|pypi| |build-status| |marshmallow3|
.. |pypi| image:: https://badgen.net/pypi/v/apispec-webframeworks :target: https://pypi.org/project/apispec-webframeworks/ :alt: PyPI package
.. |build-status| image:: https://github.com/marshmallow-code/apispec-webframeworks/actions/workflows/build-release.yml/badge.svg :target: https://github.com/marshmallow-code/apispec-webframeworks/actions/workflows/build-release.yml :alt: Build status
.. |marshmallow3| image:: https://badgen.net/badge/marshmallow/3? :target: https://marshmallow.readthedocs.io/en/latest/upgrading.html :alt: marshmallow 3 compatible
apispec <https://github.com/marshmallow-code/apispec>
_ plugins for
integrating with various web frameworks.
These plugins used to be in apispec.ext
but have since
been moved to their own package.
Included plugins:
apispec_webframeworks.aiohttp
apispec_webframeworks.bottle
apispec_webframeworks.flask
apispec_webframeworks.tornado
apispec<1.0.0
To migrate from older versions of apispec, install this package with
.. code-block:: console
pip install apispec-webframeworks
Change your imports, like so:
.. code-block:: python
# apispec<1.0.0
from apispec.ext.flask import FlaskPlugin
# apispec>=1.0.0
from apispec_webframeworks.flask import FlaskPlugin
.. code-block:: python
from flask import Flask
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from apispec_webframeworks.flask import FlaskPlugin
from marshmallow import Schema, fields
spec = APISpec(
title="Gisty",
version="1.0.0",
info=dict(description="A minimal gist API"),
plugins=[FlaskPlugin(), MarshmallowPlugin()],
)
app = Flask(__name__)
class GistParameter(Schema):
gist_id = fields.Int()
class GistSchema(Schema):
id = fields.Int()
content = fields.Str()
@app.route("/gists/<gist_id>")
def gist_detail(gist_id):
"""Gist detail view.
---
get:
parameters:
- in: path
schema: GistParameter
responses:
200:
schema: GistSchema
"""
return "details about gist {}".format(gist_id)
# Since `path` inspects the view and its route,
# we need to be in a Flask request context
with app.test_request_context():
spec.path(view=gist_detail)
For documentation for a specific plugin, see its module docstring.
::
$ pip install '.[dev]'
::
$ pre-commit install
To run all tests: ::
$ pytest
To run syntax checks: ::
$ tox -e lint
(Optional) To run tests in all supported Python versions in their own virtual environments (must have each interpreter installed): ::
$ tox
MIT licensed. See the bundled LICENSE <https://github.com/marshmallow-code/apispec_webframeworks/blob/master/LICENSE>
_ file for more details.
FAQs
Web framework plugins for apispec.
We found that apispec-webframeworks demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.