-
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
apiThis has to do with the Python API (view)This has to do with the Python API (view)cliThis has to do with the CLI ($ view)This has to do with the CLI ($ view)delayedDelayed due to another issueDelayed due to another issuefeatureNew featureNew feature
Description
Feature description
Add support for generating an API client in JavaScript (including TypeScript support) or Python.
Ideally, to separate routes that are for HTML pages, an @api
decorator could be added that marks a route for client generation. If the entire app is primarily API, a config setting like default_api = true
could be added, and then HTML pages could be marked with an @page
decorator.
It could also just be a smart system, where all GET
routes are excluded except for those that are marked.
Feature example API
$ view gen python
Created `client.py`
# app.py
from view import new_app
app = new_app()
@app.get("/pets")
async def pets():
return ["a", "b", "c"]
# client.py
class Client:
async def pets() -> List[str]:
...
# API EXAMPLE
client = Client()
await client.pets()
Anything else?
No response
Metadata
Metadata
Assignees
Labels
apiThis has to do with the Python API (view)This has to do with the Python API (view)cliThis has to do with the CLI ($ view)This has to do with the CLI ($ view)delayedDelayed due to another issueDelayed due to another issuefeatureNew featureNew feature