src/pds_doi_service/api/__main__.py
def init_app():
    """
    Performs one-time initialization on the Connexion application that serves
    the DOI API. This includes feeding in the swagger OpenAPI YAML file
    that defines the operations of the API.

    Initialization is only performed on the first call to this function. All
    future calls only return a handle to the app itself. This makes the function
    safe for use with the flask_testing package.

    Returns
    -------
    app : Connexion.App
        The initialized Connexion (Flask) application

    """
    if not app.initialized:
        CORS(app.app)
        app.app.json_encoder = encoder.JSONEncoder

        # Disable the Flask "strict_slashes" checking so endpoints with a trailing
        # slash resolve to the same endpoint as without
        app.app.url_map.strict_slashes = False

        # Feed the swagger definition to the connexion app, this informs the
        # app how to route URL's to endpoints in dois_controller.py
        app.add_api("swagger.yaml", arguments={"title": "Planetary Data System DOI Service API"}, pythonic_params=True)

        app.initialized = True

    return app

    Performs one-time initialization on the Connexion application that serves
    the DOI API. This includes feeding in the swagger OpenAPI YAML file
    that defines the operations of the API.

    Initialization is only performed on the first call to this function. All
    future calls only return a handle to the app itself. This makes the function
    safe for use with the flask_testing package.

    Returns
    -------
    app : Connexion.App
        The initialized Connexion (Flask) application

    
Performs one-time initialization on the Connexion application that serves
the DOI API. This includes feeding in the swagger OpenAPI YAML file
that defines the operations of the API.

Initialization is only performed on the first call to this function. All
future calls only return a handle to the app itself. This makes the function
safe for use with the flask_testing package.

Returns

app : Connexion.App
The initialized Connexion (Flask) application
Performs one - time initialization on the Connexion application that serves the DOI API . This includes feeding in the swagger OpenAPI YAML file that defines the operations of the API . Initialization is only performed on the first call to this function . All future calls only return a handle to the app itself . This makes the function safe for use with the flask_testing package . Returns app : Connexion . App The initialized Connexion ( Flask ) application
def init_app():
    if not app.initialized:
        CORS(app.app)
        app.app.json_encoder = encoder.JSONEncoder
        app.app.url_map.strict_slashes = False
        app.add_api("swagger.yaml", arguments={"title": "Planetary Data System DOI Service API"}, pythonic_params=True)
        app.initialized = True
    return app
def init_app ( ) : if not app . initialized : CORS ( app . app ) app . app . json_encoder = encoder . JSONEncoder app . app . url_map . strict_slashes = False app . add_api ( "swagger.yaml" , arguments = { "title" : "Planetary Data System DOI Service API" } , pythonic_params = True ) app . initialized = True return app
Performs one-time initialization on the Connexion application that serves
the DOI API.
Performs one - time initialization on the Connexion application that serves the DOI API .
"""
    Performs one-time initialization on the Connexion application that serves
    the DOI API. This includes feeding in the swagger OpenAPI YAML file
    that defines the operations of the API.

    Initialization is only performed on the first call to this function. All
    future calls only return a handle to the app itself. This makes the function
    safe for use with the flask_testing package.

    Returns
    -------
    app : Connexion.App
        The initialized Connexion (Flask) application

    """ # Disable the Flask "strict_slashes" checking so endpoints with a trailing # slash resolve to the same endpoint as without # Feed the swagger definition to the connexion app, this informs the # app how to route URL's to endpoints in dois_controller.py