def api_package(pytester):
    """Create package with structure
        api \
            mobile.py
            web.py

    mobile.py and web.py has similar content except entrypoint path
    """

    # Re-use our infrastructure layer
    pytester.copy_example('tests/conftest.py')

    # Create api/web.py and api/mobile.py files with same methods
    entrypoint_tpl = """
from fastapi import Body
from typing import List


import fastapi_jsonrpc as jsonrpc

api_v1 = jsonrpc.Entrypoint(
    '{ep_path}',
)

@api_v1.method()
def probe(
    data: List[str] = Body(..., example=['111', '222']),
    amount: int = Body(..., gt=5, example=10),
) -> List[int]:
    return [1, 2, 3]
"""

    api_dir = pytester.mkpydir('api')
    mobile_py = api_dir.joinpath('mobile.py')
    mobile_py.write_text(
        entrypoint_tpl.format(ep_path='/api/v1/mobile/jsonrpc'),
    )

    web_py = api_dir.joinpath('web.py')
    web_py.write_text(
        entrypoint_tpl.format(ep_path='/api/v1/web/jsonrpc'),
    )
    return api_dir