From 9b9ad423a80f51d374ee6d4e40d164b8f9844cfb Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 10 Oct 2019 11:16:18 -0700 Subject: [PATCH] Fix some typos (#714) * Fix some typos * s/modal/model/ --- doc/marshalling.rst | 2 +- doc/parsing.rst | 4 ++-- doc/swagger.rst | 4 ++-- flask_restplus/api.py | 6 +++--- flask_restplus/errors.py | 4 ++-- flask_restplus/mask.py | 4 ++-- flask_restplus/model.py | 2 +- flask_restplus/namespace.py | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/marshalling.rst b/doc/marshalling.rst index 098c9369..33fee685 100644 --- a/doc/marshalling.rst +++ b/doc/marshalling.rst @@ -120,7 +120,7 @@ You can use fields to multiplex a single attribute to multiple output values. This example assumes that bit 1 in the ``flags`` attribute signifies a "Normal" or "Urgent" item, and bit 2 signifies "Read" or "Unread". These items might be easy to store in a bitfield, -but for a human readable output it's nice to convert them to seperate string fields. +but for a human readable output it's nice to convert them to separate string fields. .. code-block:: python diff --git a/doc/parsing.rst b/doc/parsing.rst index 9a65becd..926a9f87 100644 --- a/doc/parsing.rst +++ b/doc/parsing.rst @@ -173,7 +173,7 @@ The :mod:`~flask_restplus.inputs` module provides some common type handling like - :func:`~inputs.boolean` for wider boolean handling - :func:`~inputs.ipv4` and :func:`~inputs.ipv6` for IP adresses -- :func:`~inputs.date_from_iso8601` and :func:`~inputs.datetime_from_iso8601` for ISO8601 date and dateime handling +- :func:`~inputs.date_from_iso8601` and :func:`~inputs.datetime_from_iso8601` for ISO8601 date and datetime handling You just have to use them as `type` argument: @@ -193,7 +193,7 @@ You can also write your own: raise ValueError('This is not my type') return parse(value) - # Swagger documntation + # Swagger documentation my_type.__schema__ = {'type': 'string', 'format': 'my-custom-format'} diff --git a/doc/swagger.rst b/doc/swagger.rst index eab6ee92..f74775c4 100644 --- a/doc/swagger.rst +++ b/doc/swagger.rst @@ -590,7 +590,7 @@ Models can also be specified with a :class:`~flask_restplus.reqparse.RequestPars .. note:: - Using :class:`~flask_restplus.reqparse.RequestParser` is prefered over the ``api.param()`` decorator + Using :class:`~flask_restplus.reqparse.RequestParser` is preferred over the ``api.param()`` decorator to document form fields as it also perform validation. Headers @@ -862,7 +862,7 @@ It supports both extensions as `dict` or `kwargs` and perform automatique `x-` p class Vendor(Resource): @api.vendor({ 'extension-1': {'works': 'with complex values'}, - 'x-extension-3': 'x- prefix is optionnal', + 'x-extension-3': 'x- prefix is optional', }) def get(self): return {} diff --git a/flask_restplus/api.py b/flask_restplus/api.py index 438da580..5817a2a5 100644 --- a/flask_restplus/api.py +++ b/flask_restplus/api.py @@ -358,7 +358,7 @@ def make_response(self, data, *args, **kwargs): raise InternalServerError() def documentation(self, func): - '''A decorator to specify a view funtion for the documentation''' + '''A decorator to specify a view function for the documentation''' self._doc_view = func return func @@ -379,7 +379,7 @@ def default_endpoint(self, resource, namespace): Endpoints are ensured not to collide. - Override this method specify a custom algoryhtm for default endpoint. + Override this method specify a custom algorithm for default endpoint. :param Resource resource: the resource for which we want an endpoint :param Namespace namespace: the namespace holding the resource @@ -565,7 +565,7 @@ def _has_fr_route(self): def error_router(self, original_handler, e): ''' - This function decides whether the error occured in a flask-restplus + This function decides whether the error occurred in a flask-restplus endpoint or not. If it happened in a flask-restplus endpoint, our handler will be dispatched. If it happened in an unrelated view, the app's original error handler will be dispatched. diff --git a/flask_restplus/errors.py b/flask_restplus/errors.py index bb1b2591..24de3d51 100644 --- a/flask_restplus/errors.py +++ b/flask_restplus/errors.py @@ -47,10 +47,10 @@ def __str__(self): class ValidationError(RestError): - '''An helper class for validation errors.''' + '''A helper class for validation errors.''' pass class SpecsError(RestError): - '''An helper class for incoherent specifications.''' + '''A helper class for incoherent specifications.''' pass diff --git a/flask_restplus/mask.py b/flask_restplus/mask.py index 7e24370f..e4c1670c 100644 --- a/flask_restplus/mask.py +++ b/flask_restplus/mask.py @@ -91,7 +91,7 @@ def parse(self, mask): raise ParseError('Missing closing bracket') def clean(self, mask): - '''Remove unecessary characters''' + '''Remove unnecessary characters''' mask = mask.replace('\n', '').strip() # External brackets are optional if mask[0] == '{': @@ -132,7 +132,7 @@ def filter_data(self, data): Handle the data filtering given a parsed mask :param dict data: the raw data to filter - :param list mask: a parsed mask tofilter against + :param list mask: a parsed mask to filter against :param bool skip: whether or not to skip missing fields ''' diff --git a/flask_restplus/model.py b/flask_restplus/model.py index 08418a5b..ede02cb4 100644 --- a/flask_restplus/model.py +++ b/flask_restplus/model.py @@ -188,7 +188,7 @@ def extend(self, name, fields): :param str name: The new model name :param dict fields: The new model extra fields - :depreated: since 0.9. Use :meth:`clone` instead. + :deprecated: since 0.9. Use :meth:`clone` instead. ''' warnings.warn('extend is is deprecated, use clone instead', DeprecationWarning, stacklevel=2) if isinstance(fields, (list, tuple)): diff --git a/flask_restplus/namespace.py b/flask_restplus/namespace.py index 6fbe7be5..8f5b5bd7 100644 --- a/flask_restplus/namespace.py +++ b/flask_restplus/namespace.py @@ -194,7 +194,7 @@ def clone(self, name, *specs): def inherit(self, name, *specs): ''' - Inherit a modal (use the Swagger composition pattern aka. allOf) + Inherit a model (use the Swagger composition pattern aka. allOf) .. seealso:: :meth:`Model.inherit` '''