HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/flask_restx/__pycache__/api.cpython-310.pyc
o

/we���@sddlZddlZddlmZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
ddlmZddlmZmZmZddlmZzddlmZWney]ddlmZYnwdd	lmZdd
lmZddlmZddl m!Z!dd
l"m#Z#m$Z$m%Z%m&Z&m'Z'ddl(m)Z*e*�+d�ddkr�ddl,m-Z.nddl,m.Z.ddl/m0Z0ddl1m2Z2m3Z3ddl4m5Z5ddl6m7Z7ddl8m9Z9ddl:m;Z;ddl<m=Z=m>Z>m?Z?ddl@mAZAddlBmCZCe�Dd�ZEdZFdeAfgZGe�HeI�ZJGd d!�d!eK�ZLGd"d#�d#e9�ZMd$d%�ZNd&d'�ZOdS)(�N)�chain)�OrderedDict)�wraps�partial)�
MethodType)�url_for�request�current_app)�
make_response)�_endpoint_from_view_func)�got_request_exception)�RefResolver)�cached_property)�Headers)�
HTTPException�MethodNotAllowed�NotFound�
NotAcceptable�InternalServerError)�__version__�.�2)�Response)�BaseResponse�)�apidoc)�
ParseError�	MaskError)�	Namespace)�PostmanCollectionV1)�Resource)�Swagger)�
default_id�
camel_to_dash�unpack)�output_json)�
HTTPStatusz(<.*>))zContent-Length�application/jsonc@s�eZdZdZdddddddddddddeddddddd	dddddd
fdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zdcd1d2�Zd3d4�Zd5d6�Zed7d8��Zed9d:��Zed;d<��Zed=d>��Z ed?d@��Z!dAdB�Z"dCdD�Z#dEdF�Z$dGdH�Z%dIdJ�Z&dKdL�Z'dcdMdN�Z(dddOdP�Z)edQdR��Z*edSdT��Z+e,	dedUdV��Z-dWdX�Z.dYdZ�Z/d[d\�Z0d]d^�Z1d_d`�Z2dadb�Z3dS)f�Apia�

    The main entry point for the application.
    You need to initialize it with a Flask Application: ::

    >>> app = Flask(__name__)
    >>> api = Api(app)

    Alternatively, you can use :meth:`init_app` to set the Flask application
    after it has been constructed.

    The endpoint parameter prefix all views and resources:

        - The API root/documentation will be ``{endpoint}.root``
        - A resource registered as 'resource' will be available as ``{endpoint}.resource``

    :param flask.Flask|flask.Blueprint app: the Flask application object or a Blueprint
    :param str version: The API version (used in Swagger documentation)
    :param str title: The API title (used in Swagger documentation)
    :param str description: The API description (used in Swagger documentation)
    :param str terms_url: The API terms page URL (used in Swagger documentation)
    :param str contact: A contact email for the API (used in Swagger documentation)
    :param str license: The license associated to the API (used in Swagger documentation)
    :param str license_url: The license page URL (used in Swagger documentation)
    :param str endpoint: The API base endpoint (default to 'api).
    :param str default: The default namespace base name (default to 'default')
    :param str default_label: The default namespace label (used in Swagger documentation)
    :param str default_mediatype: The default media type to return
    :param bool validate: Whether or not the API should perform input payload validation.
    :param bool ordered: Whether or not preserve order models and marshalling.
    :param str doc: The documentation path. If set to a false value, documentation is disabled.
                (Default to '/')
    :param list decorators: Decorators to attach to every resource
    :param bool catch_all_404s: Use :meth:`handle_error`
        to handle 404 errors throughout your app
    :param dict authorizations: A Swagger Authorizations declaration as dictionary
    :param bool serve_challenge_on_401: Serve basic authentication challenge with 401
        responses (default 'False')
    :param FormatChecker format_checker: A jsonschema.FormatChecker object that is hooked into
        the Model validator. A default or a custom FormatChecker can be provided (e.g., with custom
        checkers), otherwise the default action is to not enforce any format validation.
    :param url_scheme: If set to a string (e.g. http, https), then the specs_url and base_url will explicitly use this
        scheme regardless of how the application is deployed. This is necessary for some deployments behind a reverse
        proxy.
    :param str default_swagger_filename: The default swagger filename.
    Nz1.0�/�defaultzDefault namespace�Fr'zswagger.jsoncKsL||_|pd|_||_||_||_|
|_|	|_||_||_||_	||_
||_||_||_
|
|_d|_d|_|p8g|_ttttti�|_d|_i|_d|_||_g|_||_t�|_tt �|_!i|_"||_#||_$|rk|ng|_%||_&||_'d|_(t)�|_*g|_+d|_,d|_-|j.||d�/|�||dd�|_0||_1|dur�||_,|�2|�dSdS)N�APIz{0}-declarationr))�endpoint�validate�api�path)3�version�title�description�	terms_url�contact�
contact_email�contact_url�license�license_url�authorizations�securityr"�ordered�	_validate�_doc�	_doc_view�_default_error_handler�tagsrr�mask_parse_error_handlerr�mask_error_handler�error_handlers�_schema�models�_refresolver�format_checker�
namespaces�default_swagger_filename�dict�ns_paths�DEFAULT_REPRESENTATIONS�representations�urls�prefix�default_mediatype�
decorators�catch_all_404s�serve_challenge_on_401�blueprint_setup�set�	endpoints�	resources�app�	blueprint�	namespace�format�default_namespace�
url_scheme�init_app)�selfrYr1r2r3r4r8r9r5r7r6r:r;�docr"r*�
default_labelr.rArPr<rQrRrSrTrHr^rJ�kwargs�rd�H/home/arjun/projects/env/lib/python3.10/site-packages/flask_restx/api.py�__init__msn

��
��zApi.__init__cKs�||_|�d|j�|_|�d|j�|_|�d|j�|_|�d|j�|_|�d|j�|_|�d|j�|_|�d|j�|_|�d|j	�|_	|�d	|j
�|_
|�d
d�|_|�|�|�
|�z|�|j�Wntys|�|�YdSw||_dS)
a�
        Allow to lazy register the API on a Flask application::

        >>> app = Flask(__name__)
        >>> api = Api()
        >>> api.init_app(app)

        :param flask.Flask app: the Flask application object
        :param str title: The API title (used in Swagger documentation)
        :param str description: The API description (used in Swagger documentation)
        :param str terms_url: The API terms page URL (used in Swagger documentation)
        :param str contact: A contact email for the API (used in Swagger documentation)
        :param str license: The license associated to the API (used in Swagger documentation)
        :param str license_url: The license page URL (used in Swagger documentation)
        :param url_scheme: If set to a string (e.g. http, https), then the specs_url and base_url will explicitly use
            this scheme regardless of how the application is deployed. This is necessary for some deployments behind a
            reverse proxy.
        r2r3r4r5r7r6r8r9r^�	add_specsTN)rY�getr2r3r4r5r7r6r8r9r^�
_add_specs�_register_specs�
_register_doc�record�_deferred_blueprint_init�AttributeError�	_init_apprZ)r`rYrcrdrdrer_�s&

�
zApi.init_appcCs�t|j|j�|_t|j|j�|_t|j�dkr/|jD]\}}}}|j|||g|�Ri|��q|jD]}|�||�q2|�	|�|j
durH|j
n|j�dd�|_
|j�
dd�|j�
dd�|j�
d	d�d
|jvrz|jd
|jd<t�dt�dSdS)
z�
        Perform initialization actions with the given :class:`flask.Flask` object.

        :param flask.Flask app: The flask application object
        rN�RESTX_VALIDATEF�RESTX_MASK_HEADERzX-Fields�RESTX_MASK_SWAGGERT�RESTX_INCLUDE_ALL_MODELS�ERROR_404_HELP�RESTX_ERROR_404_HELPzt'ERROR_404_HELP' config setting is deprecated and will be removed in the future. Use 'RESTX_ERROR_404_HELP' instead.)r�error_router�handle_exception�handle_user_exception�lenrX�_register_viewrI�_configure_namespace_logger�_register_apidocr=�configrh�
setdefault�warnings�warn�DeprecationWarning)r`rY�resourcer[rOrc�nsrdrdrero�s0�


��
��z
Api._init_appcCs,zt|j|�WStytd�|���w)NzApi does not have {0} attribute)�getattrr]rnr\�r`�namerdrdre�__getattr__s
�zApi.__getattr__cCs ||j|f}d�dd�|D��S)ar
        This method is used to defer the construction of the final url in
        the case that the Api is created with a Blueprint.

        :param url_part: The part of the url the endpoint is registered with
        :param registration_prefix: The part of the url contributed by the
            blueprint.  Generally speaking, BlueprintSetupState.url_prefix
        r+css�|]}|r|VqdS�Nrd)�.0�partrdrdre�	<genexpr>)��z$Api._complete_url.<locals>.<genexpr>)rP�join)r`�url_part�registration_prefix�partsrdrdre�
_complete_urls	zApi._complete_urlcCs2|j�di�}|�dd�s|�tj�d|d<dS)N�restx�apidoc_registeredFT)�
extensionsr~rh�register_blueprintr)r`rY�confrdrdrer|+szApi._register_apidoccCsB|jrtd�}|j|t|jd|j||fd�|j�|�dSdS)N�specsr))r-�resource_class_args)ri�strrz�SwaggerViewr]rJrW�add)r`�app_or_blueprintr-rdrdrerj1s��zApi._register_specscCs8|jr|jr|�|jd|j�|�|jpdd|j�dS)Nrar)�root)rir>�add_url_rule�
render_docrP�render_root)r`r�rdrdrerk>szApi._register_doccOsx|�dd�}t|p|�||��}||d<|j�|�|jdur0|j|j||g|�Ri|��|S|j�||||f�|S)Nr-)	�popr��default_endpointrWr�rYrzrX�append)r`r[r�rOrcr-rdrdre�register_resourceDs
�zApi.register_resourcecCs.|jjD]}|j�|�q|j�|jj�dSr�)�logger�handlers�
addHandler�setLevel�level)r`rYr[�handlerrdrdrer{QszApi._configure_namespace_loggercOs|�dd�p
t|j�}|�dd�}|�di�}|t|di�vr6|j|jd}	|	|kr6d}
t|
||	jf��|��|_||_	|�
|j||g|�Ri|���}t|j
|j
�D]}||�}qU|D]-}
|jrz|jrs|jj|
fd|i|��q^t|j|
�}n|�|
d	�}|j|fd|i|��q^dS)
Nr-r�rd�resource_class_kwargs�view_functions�
view_classz2This endpoint (%s) is already set to the class %s.�	view_funcr+)r�r#�__name__r�r��__dict__�
ValueError�mediatypes_method�
mediatypesr-�output�as_viewrrRrZrUr�rr�)r`rYr�r[rOrcr-r�r��previous_view_class�msg�
resource_func�	decorator�url�rulerdrdrerzVsH
����
����zApi._register_viewcst����fdd��}|S)z�
        Wraps a resource (as a flask view function),
        for cases where the resource does not directly return a response object

        :param resource: The resource as a flask view function
        cs:�|i|��}t|t�r|St|�\}}}�j|||d�S)N)�headers)�
isinstancerr$r
)�argsrc�resp�data�coder��r�r`rdre�wrapper�s

zApi.output.<locals>.wrapper)r)r`r�r�rdr�rer��sz
Api.outputcOs�|�dd�p|j}tjj|j|d�}|durt��||jvr3|j||g|�Ri|��}||jd<|S|dkrKtt	|�g|�Ri|��}d|jd<|St
��)a�
        Looks up the representation transformer for the requested media
        type, invoking the transformer to create a response object. This
        defaults to default_mediatype if no transformer is found for the
        requested mediatype. If default_mediatype is None, a 406 Not
        Acceptable response will be sent as per RFC 2616 section 14.1

        :param data: Python object containing response data to be transformed
        �fallback_mediatypeN)r*zContent-Type�
text/plain)r�rQr�accept_mimetypes�
best_matchrNrr��original_flask_make_responser�r)r`r�r�rcrQ�	mediatyper�rdrdrer
�s"��


zApi.make_responsecCs
||_|S)z<A decorator to specify a view function for the documentation)r?)r`�funcrdrdre�
documentation�szApi.documentationcCs|�tj�dSr�)�abortr&�	NOT_FOUND�r`rdrdrer��szApi.render_rootcCs*|jr|��S|js|�tj�t�|�S)z8Override this method to customize the documentation page)r?r>r�r&r�r�ui_forr�rdrdrer��s

zApi.render_doccCsbt|j�}||jurdj||d�}||jvr/d}	dj||d�}||jvr*|}	|S|d7}q|S)a�
        Provide a default endpoint for a resource on a given namespace.

        Endpoints are ensured not to collide.

        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
        :returns str: An endpoint name
        z{ns.name}_{endpoint})r�r-�Tz{base}_{suffix})�base�suffixr)r#r�r]r\rW)r`r�r[r-r��new_endpointrdrdrer��s



��zApi.default_endpointcCs|j�|�Sr�)rLrh)r`r�rdrdre�get_ns_path�szApi.get_ns_pathcs"|�|�p|j��fdd�|D�S)Ncsg|]}�|�qSrdrd)r�r��r0rdre�
<listcomp>�szApi.ns_urls.<locals>.<listcomp>)r�r0)r`r�rOrdr�re�ns_urls�szApi.ns_urlscCs�||jvr|j�|�||jvr|j�|�|dur||j|<|jD]}|�||j�}|j||jg|�Ri|j	��q"|j
��D]	\}}||j
|<q@|js[|j
dur]|�|j
|�dSdSdS)a
        This method registers resources from namespace for current instance of api.
        You can use argument path for definition custom prefix url for namespace.

        :param Namespace ns: the namespace
        :param path: registration prefix of namespace
        N)rIr��apisrLrXr�rOr�r�rcrF�itemsrZrYr{)r`r�r0�rrOr��
definitionrdrdre�
add_namespace�s



 �zApi.add_namespacecOs.|�d|j�|d<t|i|��}|�|�|S)z\
        A namespace factory.

        :returns Namespace: a new namespace instance
        r<)rhr<rr�)r`r�rcr�rdrdrer[s
z
Api.namespacecCs|jrd�|jj|�S|S)N�{0}.{1})rZr\r�r�rdrdrer-szApi.endpointcCs(|jdurdnd}t|�d�|j|d�S)z�
        The Swagger specifications relative url (ie. `swagger.json`). If
        the spec_url_scheme attribute is set, then the full url is provided instead
        (e.g. http://localhost/swaggger.json).

        :rtype: str
        NTr���_scheme�	_external)r^rr-)r`�externalrdrdre�	specs_urls	�z
Api.specs_urlcCst|�d�|jdd�S)z@
        The API base absolute url

        :rtype: str
        r�Tr�)rr-r^r�rdrdre�base_url"szApi.base_urlcCst|�d�dd�S)z3
        The API path

        :rtype: str
        r�F)r�)rr-r�rdrdre�	base_path+sz
Api.base_pathcCsL|js#zt|���|_W|jSty"d}t�|�d|iYSw|jS)zz
        The Swagger specifications/schema for this API

        :returns dict: the schema as a serializable dict
        zUnable to render schema�error)rEr!�as_dict�	Exception�log�	exception)r`r�rdrdre�
__schema__4s�
�zApi.__schema__cCs>t�}|�|j�|jD]}|j��D]\}}|||<qq|Sr�)r�updaterDrIr�)r`�rvr�r�r�rdrdre�_own_and_child_error_handlersFs

�z!Api._own_and_child_error_handlerscs0t���rt�t�r��fdd�}|S��_�S)z>A decorator to register an error handler for a given exceptionc�|�j�<|Sr�)rD�r��r�r`rdrer�S�
z!Api.errorhandler.<locals>.wrapper)�inspect�isclass�
issubclassr�r@)r`r�r�rdr�re�errorhandlerOs
zApi.errorhandlercCs<|jr|�|jj�r|�|jjdd�d}ndS||jvS)z�
        Tests if an endpoint name (not path) belongs to this Api.
        Takes into account the Blueprint name part of the endpoint name.

        :param str endpoint: The name of the endpoint being checked
        :return: bool
        rr���F)rZ�
startswithr��splitrW)r`r-rdrdre�
owns_endpoint]s
	
zApi.owns_endpointc
Cs�t�t�}z|��WdSty2}z|jd}|j|dd�\}}|�|j�WYd}~Sd}~wty=|j	YSt
yFYdSw)a5
        Determine if error should be handled with FR or default Flask

        The goal is to return Flask error handlers for non-FR-related routes,
        and FR errors (with the correct media type) for FR endpoints. This
        method currently handles 404 and 405 errors.

        :return: bool
        rT)�method�return_ruleN)r	�create_url_adapterr�matchr�
valid_methodsr�r-rrSr�)r`�adapter�e�valid_route_methodr��_rdrdre�_should_use_fr_error_handlerms


�
�z Api._should_use_fr_error_handlercCs$|��rdStjsdS|�tjj�S)zGEncapsulating the rules for whether the request was to a Flask endpointTF)rr�url_ruler�r-r�rdrdre�
_has_fr_route�s
zApi._has_fr_routec
CsJ|��r!z|�|�WSty }z
||�WYd}~Sd}~ww||�S)a�
        This function decides whether the error occurred in a flask-restx
        endpoint or not. If it happened in a flask-restx endpoint, our
        handler will be dispatched. If it happened in an unrelated view, the
        app's original error handler will be dispatched.
        In the event that the error occurred in a flask-restx endpoint but
        the local handler can't resolve the situation, the router will fall
        back onto the original_handler as last resort.

        :param function original_handler: the original Flask error handler for the app
        :param Exception e: the exception raised while handling the request
        N)r�handle_errorr�)r`�original_handlerr�frdrdrerv�s
��zApi.error_routercCst|t�s$tj�dd�r$t|t|j����s$t�	�\}}}||ur"�|�tj�dd�}i}t
�}|j��D]\}}	t||�rM|	|�}
t|
t
j�\}}}nAq5tjt��|d�t|t�rrt
|j�}|rldt|d|j�i}|��j}n|jr�|�|�}
t|
t
j�\}}}n
t
j}|r�d|ji}|r�|�dt|��|d<t|d|�}d	}
|t
jkr�t�	�}|d
d	ur�d	}t�|�n3|t
jkr�tj�dd�r�|r�|�|�dd	��|d<n|t
jkr�|jd	ur�t|j���}|r�|dnd
}
t D]}|�!|d	�q�|j"||||
d�}|t
j#k�r|�$|�}|S)z�
        Error handler for the API transforms a raised exception into a Flask response,
        with the appropriate HTTP status code and body.

        :param Exception e: the raised Exception object

        �PROPAGATE_EXCEPTIONSF�ERROR_INCLUDE_MESSAGET)r��messager3r�Nrrurr�)r�)%r�rr	r}rh�tupler��keys�sys�exc_inforr�r$r&�INTERNAL_SERVER_ERRORr�send�_get_current_objectr�r��phrase�get_responser�r@r��
log_exceptionr��_help_on_404�NOT_ACCEPTABLErQ�listrN�HEADERS_BLACKLISTr�r
�UNAUTHORIZED�unauthorized)r`r�exc_type�	exc_value�tb�include_message_in_response�default_datar��	typecheckr��resultr�r�r�r�supported_mediatypes�headerr�rdrdrer�s�����

��	


��

����
zApi.handle_errorcsptdd�tj��D���t�tj����}|r6d�	|r"|�
d�dnddtjdd�	�fd	d
�|D��df�}|S)NcSs g|]}t�d|j�|jf�qS)r+)�RE_RULES�subr�)r�r�rdrdrer�	s��z$Api._help_on_404.<locals>.<listcomp>r+rz. zYou have requested this URI [z] but did you mean z or c3s�|]}�|VqdSr�rd)r�r���rulesrdrer�r�z#Api._help_on_404.<locals>.<genexpr>z ?)rKr	�url_map�
iter_rules�difflib�get_close_matchesrr0r
r��rstrip)r`r�
close_matchesrdr'rers"����
zApi._help_on_404cCst||d�j|d�S)z�
        Serialize the API as Postman collection (v1)

        :param bool urlvars: whether to include or not placeholders for query strings
        :param bool swagger: whether to include or not the swagger.json specifications

        )�swagger)�urlvars)rr�)r`r0r/rdrdre�
as_postmanszApi.as_postmancCst��S)z6Store the input payload in the current request context)r�get_jsonr�rdrdre�payload'szApi.payloadcCs|js
t�|j�|_|jSr�)rGr
�from_schemar�r�rdrdre�refresolver,szApi.refresolvercKs�t|�r
||j�}n|jr|j|}|�d|j�|dur!t|�}|j}d|vr3t|fi|�d���}|jj	|d|j
j|f|fd|i|��dS)a�
        Method used to patch BlueprintSetupState.add_url_rule for setup
        state instance corresponding to this Api instance.  Exists primarily
        to enable _complete_url's function.

        :param blueprint_setup: The BlueprintSetupState instance (self)
        :param rule: A string or callable that takes a string and returns a
            string(_complete_url) that is the url rule for the endpoint
            being registered
        :param endpoint: See BlueprintSetupState.add_url_rule
        :param view_func: See BlueprintSetupState.add_url_rule
        :param **options: See BlueprintSetupState.add_url_rule
        �	subdomainN�defaultsz%s.%s)�callable�
url_prefixr~r6r�url_defaultsrKr�rYr�rZr�)rUr�r-r��optionsr7rdrdre�#_blueprint_setup_add_url_rule_patch2s&
��
�z'Api._blueprint_setup_add_url_rule_patchcCsF||_|jjdkr|j|_ttj|�|_|jstd��|�	|j
�dS)a�
        Synchronize prefix between blueprint/api and registration options, then
        perform initialization with setup_state.app :class:`flask.Flask` object.
        When a :class:`flask_restx.Api` object is initialized with a blueprint,
        this method is recorded on the blueprint to be run when the blueprint is later
        registered to a :class:`flask.Flask` object.  This method also monkeypatches
        BlueprintSetupState.add_url_rule with _blueprint_setup_add_url_rule_patch.

        :param setup_state: The setup state object passed to deferred functions
            during blueprint registration
        :type setup_state: flask.blueprints.BlueprintSetupState

        r<z3flask-restx blueprints can only be registered once.N)rUr�r��_original_add_url_rulerr(r<�first_registrationr�rorY)r`�setup_staterdrdrermVs�zApi._deferred_blueprint_initcs�fdd�S)z1Return a method that returns a list of mediatypescs����jgSr�)r�rQ)�resource_clsr�rdre�<lambda>qsz'Api.mediatypes_method.<locals>.<lambda>rdr�rdr�rer�oszApi.mediatypes_methodcCs dd�ttjt�d�dd�D�S)z@Returns a list of requested mediatypes sent in the Accept headercSsg|]\}}|�qSrdrd)r��h�qrdrdrer�us��z"Api.mediatypes.<locals>.<listcomp>rT)�key�reverse)�sortedrr��operator�
itemgetterr�rdrdrer�ss
��zApi.mediatypescs��fdd�}|S)a
        Allows additional representation transformers to be declared for the
        api. Transformers are functions that must be decorated with this
        method, passing the mediatype the transformer represents. Three
        arguments are passed to the transformer:

        * The data to be represented in the response body
        * The http status code
        * A dictionary of headers

        The transformer should convert the data appropriately for the mediatype
        and return a Flask response object.

        Ex::

            @api.representation('application/xml')
            def xml(data, code, headers):
                resp = make_response(convert_data_to_xml(data), code)
                resp.headers.extend(headers)
                return resp
        cr�r�)rNr��r�r`rdrer��r�z#Api.representation.<locals>.wrapperrd)r`r�r�rdrIre�representation|szApi.representationcCs.|jrtj�dd�}d�d|�}||jd<|S)z2Given a response, change it to ask for credentials�HTTP_BASIC_AUTH_REALMzflask-restxz{0} realm="{1}"�BasiczWWW-Authenticate)rTr	r}rhr\r�)r`�response�realm�	challengerdrdrer�s

zApi.unauthorizedcKs,|j}|jrd�|jj|�}t|fi|��S)zc
        Generates a URL to the given resource.

        Works like :func:`flask.url_for`.
        r�)r-rZr\r�r)r`r��valuesr-rdrdrer�szApi.url_forr�)FF)NN)4r��
__module__�__qualname__�__doc__r"rfr_ror�r�r|rjrkr�r{rzr�r
r�r�r�r�r�r�r�r[r-�propertyr�r�r�rr�r�r�r�rrrvrrr1r3r5�staticmethodr<rmr�r�rJrrrdrdrdrer(>s�0
�]*%

4







c



�#	
r(c@s eZdZdZdd�Zdd�ZdS)r�z)Render the Swagger specifications as JSONcCs"|jj}|d|vr
tjfStjfS)Nr�)r/r�r&r�OK)r`�schemardrdrerh�s��zSwaggerView.getcCsdgS)Nr'rdr�rdrdrer��szSwaggerView.mediatypesN)r�rQrRrSrhr�rdrdrdrer��sr�cC�dd�|�itjfS)zWhen a mask can't be parsedrzMask parse error: {0}�r\r&�BAD_REQUEST�r�rdrdrerB��rBcCrX)zWhen any error occurs on maskrzMask error: {0}rYr[rdrdrerC�r\rC)Pr+r��	itertoolsr�loggingrG�rerr�collectionsr�	functoolsrr�typesr�flaskrrr	r
r��
flask.helpersr�ImportError�flask.scaffold�
flask.signalsr�
jsonschemar
�werkzeug.utilsr�werkzeug.datastructuresr�werkzeug.exceptionsrrrrr�werkzeugr�werkzeug_versionr��werkzeug.wrappersrrr+r�maskrrr[r�postmanrr�r r/r!�utilsr"r#r$rNr%�_httpr&�compiler%rrM�	getLoggerr�r��objectr(r�rBrCrdrdrdre�<module>sd�


w