SchemaGenerator doesn't work with mounted apps that don't implement routes #1958
Unanswered
and3rson
asked this question in
Potential Issue
Replies: 1 comment
-
Support for extra argument on graphql = GraphQL(...)
routes = [
Mount("/graphql", app=graphql, name="graphql", schema=graphql.get_openapi_schema())
] For schema we could do: class RouteResponseSchema(TypedDict):
description: str | null
examples: str | null
class RouteSchema(TypedDict):
path: str
method: str
description: str | null
responses: Dict[int, RouteResponseSchema] | null
Schema = Sequence[RouteSchema] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Related issue: mirumee/ariadne#975
Since ariadne doesn't expose any routes but a single
__call__
method, starlette'sSchemaGenerator.get_endpoints
doesn't return any routes for it.Is it possible to make
SchemaGenerator
call some method (if it exists) on a mounted app (say,get_openapi_schema() -> str
or) in order to allow the latter to provide openapi spec for starlette? Alternative option could be to takeget_openapi_endpoints() -> Iterable[EndpointInfo]
__doc__
directly from the mounted app in addition to taking its.routes
. Not sure if either of these approaches will allow the mounted app to provide spec for more than one endpoint though...Any suggestions are welcome!
Beta Was this translation helpful? Give feedback.
All reactions