litestar-vite 0.1.1__py3-none-any.whl → 0.15.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. litestar_vite/__init__.py +54 -4
  2. litestar_vite/__metadata__.py +12 -7
  3. litestar_vite/cli.py +1048 -10
  4. litestar_vite/codegen/__init__.py +48 -0
  5. litestar_vite/codegen/_export.py +229 -0
  6. litestar_vite/codegen/_inertia.py +619 -0
  7. litestar_vite/codegen/_openapi.py +280 -0
  8. litestar_vite/codegen/_routes.py +720 -0
  9. litestar_vite/codegen/_ts.py +235 -0
  10. litestar_vite/codegen/_utils.py +141 -0
  11. litestar_vite/commands.py +73 -0
  12. litestar_vite/config/__init__.py +997 -0
  13. litestar_vite/config/_constants.py +97 -0
  14. litestar_vite/config/_deploy.py +70 -0
  15. litestar_vite/config/_inertia.py +241 -0
  16. litestar_vite/config/_paths.py +63 -0
  17. litestar_vite/config/_runtime.py +235 -0
  18. litestar_vite/config/_spa.py +93 -0
  19. litestar_vite/config/_types.py +94 -0
  20. litestar_vite/deploy.py +366 -0
  21. litestar_vite/doctor.py +1181 -0
  22. litestar_vite/exceptions.py +78 -0
  23. litestar_vite/executor.py +360 -0
  24. litestar_vite/handler/__init__.py +9 -0
  25. litestar_vite/handler/_app.py +612 -0
  26. litestar_vite/handler/_routing.py +130 -0
  27. litestar_vite/html_transform.py +569 -0
  28. litestar_vite/inertia/__init__.py +77 -0
  29. litestar_vite/inertia/_utils.py +119 -0
  30. litestar_vite/inertia/exception_handler.py +178 -0
  31. litestar_vite/inertia/helpers.py +1571 -0
  32. litestar_vite/inertia/middleware.py +54 -0
  33. litestar_vite/inertia/plugin.py +199 -0
  34. litestar_vite/inertia/precognition.py +274 -0
  35. litestar_vite/inertia/request.py +334 -0
  36. litestar_vite/inertia/response.py +802 -0
  37. litestar_vite/inertia/types.py +335 -0
  38. litestar_vite/loader.py +464 -123
  39. litestar_vite/plugin/__init__.py +687 -0
  40. litestar_vite/plugin/_process.py +185 -0
  41. litestar_vite/plugin/_proxy.py +689 -0
  42. litestar_vite/plugin/_proxy_headers.py +244 -0
  43. litestar_vite/plugin/_static.py +37 -0
  44. litestar_vite/plugin/_utils.py +489 -0
  45. litestar_vite/py.typed +0 -0
  46. litestar_vite/scaffolding/__init__.py +20 -0
  47. litestar_vite/scaffolding/generator.py +270 -0
  48. litestar_vite/scaffolding/templates.py +437 -0
  49. litestar_vite/templates/__init__.py +0 -0
  50. litestar_vite/templates/addons/tailwindcss/tailwind.css.j2 +1 -0
  51. litestar_vite/templates/angular/index.html.j2 +12 -0
  52. litestar_vite/templates/angular/openapi-ts.config.ts.j2 +18 -0
  53. litestar_vite/templates/angular/package.json.j2 +36 -0
  54. litestar_vite/templates/angular/src/app/app.component.css.j2 +3 -0
  55. litestar_vite/templates/angular/src/app/app.component.html.j2 +1 -0
  56. litestar_vite/templates/angular/src/app/app.component.ts.j2 +9 -0
  57. litestar_vite/templates/angular/src/app/app.config.ts.j2 +5 -0
  58. litestar_vite/templates/angular/src/main.ts.j2 +9 -0
  59. litestar_vite/templates/angular/src/styles.css.j2 +9 -0
  60. litestar_vite/templates/angular/tsconfig.app.json.j2 +34 -0
  61. litestar_vite/templates/angular/tsconfig.json.j2 +20 -0
  62. litestar_vite/templates/angular/vite.config.ts.j2 +21 -0
  63. litestar_vite/templates/angular-cli/.postcssrc.json.j2 +5 -0
  64. litestar_vite/templates/angular-cli/angular.json.j2 +36 -0
  65. litestar_vite/templates/angular-cli/openapi-ts.config.ts.j2 +18 -0
  66. litestar_vite/templates/angular-cli/package.json.j2 +28 -0
  67. litestar_vite/templates/angular-cli/proxy.conf.json.j2 +18 -0
  68. litestar_vite/templates/angular-cli/src/app/app.component.css.j2 +3 -0
  69. litestar_vite/templates/angular-cli/src/app/app.component.html.j2 +1 -0
  70. litestar_vite/templates/angular-cli/src/app/app.component.ts.j2 +9 -0
  71. litestar_vite/templates/angular-cli/src/app/app.config.ts.j2 +5 -0
  72. litestar_vite/templates/angular-cli/src/index.html.j2 +13 -0
  73. litestar_vite/templates/angular-cli/src/main.ts.j2 +6 -0
  74. litestar_vite/templates/angular-cli/src/styles.css.j2 +10 -0
  75. litestar_vite/templates/angular-cli/tailwind.config.js.j2 +4 -0
  76. litestar_vite/templates/angular-cli/tsconfig.app.json.j2 +16 -0
  77. litestar_vite/templates/angular-cli/tsconfig.json.j2 +26 -0
  78. litestar_vite/templates/angular-cli/tsconfig.spec.json.j2 +9 -0
  79. litestar_vite/templates/astro/astro.config.mjs.j2 +28 -0
  80. litestar_vite/templates/astro/openapi-ts.config.ts.j2 +15 -0
  81. litestar_vite/templates/astro/src/layouts/Layout.astro.j2 +63 -0
  82. litestar_vite/templates/astro/src/pages/index.astro.j2 +36 -0
  83. litestar_vite/templates/astro/src/styles/global.css.j2 +1 -0
  84. litestar_vite/templates/base/.gitignore.j2 +42 -0
  85. litestar_vite/templates/base/openapi-ts.config.ts.j2 +15 -0
  86. litestar_vite/templates/base/package.json.j2 +39 -0
  87. litestar_vite/templates/base/resources/vite-env.d.ts.j2 +1 -0
  88. litestar_vite/templates/base/tsconfig.json.j2 +37 -0
  89. litestar_vite/templates/htmx/src/main.js.j2 +8 -0
  90. litestar_vite/templates/htmx/templates/base.html.j2.j2 +56 -0
  91. litestar_vite/templates/htmx/templates/index.html.j2.j2 +13 -0
  92. litestar_vite/templates/htmx/vite.config.ts.j2 +40 -0
  93. litestar_vite/templates/nuxt/app.vue.j2 +29 -0
  94. litestar_vite/templates/nuxt/composables/useApi.ts.j2 +33 -0
  95. litestar_vite/templates/nuxt/nuxt.config.ts.j2 +31 -0
  96. litestar_vite/templates/nuxt/openapi-ts.config.ts.j2 +15 -0
  97. litestar_vite/templates/nuxt/pages/index.vue.j2 +54 -0
  98. litestar_vite/templates/react/index.html.j2 +13 -0
  99. litestar_vite/templates/react/src/App.css.j2 +56 -0
  100. litestar_vite/templates/react/src/App.tsx.j2 +19 -0
  101. litestar_vite/templates/react/src/main.tsx.j2 +10 -0
  102. litestar_vite/templates/react/vite.config.ts.j2 +39 -0
  103. litestar_vite/templates/react-inertia/index.html.j2 +14 -0
  104. litestar_vite/templates/react-inertia/package.json.j2 +47 -0
  105. litestar_vite/templates/react-inertia/resources/App.css.j2 +68 -0
  106. litestar_vite/templates/react-inertia/resources/main.tsx.j2 +17 -0
  107. litestar_vite/templates/react-inertia/resources/pages/Home.tsx.j2 +18 -0
  108. litestar_vite/templates/react-inertia/resources/ssr.tsx.j2 +19 -0
  109. litestar_vite/templates/react-inertia/vite.config.ts.j2 +59 -0
  110. litestar_vite/templates/react-router/index.html.j2 +12 -0
  111. litestar_vite/templates/react-router/src/App.css.j2 +17 -0
  112. litestar_vite/templates/react-router/src/App.tsx.j2 +7 -0
  113. litestar_vite/templates/react-router/src/main.tsx.j2 +10 -0
  114. litestar_vite/templates/react-router/vite.config.ts.j2 +39 -0
  115. litestar_vite/templates/react-tanstack/index.html.j2 +12 -0
  116. litestar_vite/templates/react-tanstack/openapi-ts.config.ts.j2 +18 -0
  117. litestar_vite/templates/react-tanstack/src/App.css.j2 +17 -0
  118. litestar_vite/templates/react-tanstack/src/main.tsx.j2 +21 -0
  119. litestar_vite/templates/react-tanstack/src/routeTree.gen.ts.j2 +7 -0
  120. litestar_vite/templates/react-tanstack/src/routes/__root.tsx.j2 +9 -0
  121. litestar_vite/templates/react-tanstack/src/routes/books.tsx.j2 +9 -0
  122. litestar_vite/templates/react-tanstack/src/routes/index.tsx.j2 +9 -0
  123. litestar_vite/templates/react-tanstack/vite.config.ts.j2 +39 -0
  124. litestar_vite/templates/svelte/index.html.j2 +13 -0
  125. litestar_vite/templates/svelte/src/App.svelte.j2 +30 -0
  126. litestar_vite/templates/svelte/src/app.css.j2 +45 -0
  127. litestar_vite/templates/svelte/src/main.ts.j2 +8 -0
  128. litestar_vite/templates/svelte/src/vite-env.d.ts.j2 +2 -0
  129. litestar_vite/templates/svelte/svelte.config.js.j2 +5 -0
  130. litestar_vite/templates/svelte/vite.config.ts.j2 +39 -0
  131. litestar_vite/templates/svelte-inertia/index.html.j2 +14 -0
  132. litestar_vite/templates/svelte-inertia/resources/app.css.j2 +21 -0
  133. litestar_vite/templates/svelte-inertia/resources/main.ts.j2 +11 -0
  134. litestar_vite/templates/svelte-inertia/resources/pages/Home.svelte.j2 +43 -0
  135. litestar_vite/templates/svelte-inertia/resources/vite-env.d.ts.j2 +2 -0
  136. litestar_vite/templates/svelte-inertia/svelte.config.js.j2 +5 -0
  137. litestar_vite/templates/svelte-inertia/vite.config.ts.j2 +37 -0
  138. litestar_vite/templates/sveltekit/openapi-ts.config.ts.j2 +15 -0
  139. litestar_vite/templates/sveltekit/src/app.css.j2 +40 -0
  140. litestar_vite/templates/sveltekit/src/app.html.j2 +12 -0
  141. litestar_vite/templates/sveltekit/src/hooks.server.ts.j2 +55 -0
  142. litestar_vite/templates/sveltekit/src/routes/+layout.svelte.j2 +12 -0
  143. litestar_vite/templates/sveltekit/src/routes/+page.svelte.j2 +34 -0
  144. litestar_vite/templates/sveltekit/svelte.config.js.j2 +12 -0
  145. litestar_vite/templates/sveltekit/tsconfig.json.j2 +14 -0
  146. litestar_vite/templates/sveltekit/vite.config.ts.j2 +31 -0
  147. litestar_vite/templates/vue/env.d.ts.j2 +7 -0
  148. litestar_vite/templates/vue/index.html.j2 +13 -0
  149. litestar_vite/templates/vue/src/App.vue.j2 +28 -0
  150. litestar_vite/templates/vue/src/main.ts.j2 +5 -0
  151. litestar_vite/templates/vue/src/style.css.j2 +45 -0
  152. litestar_vite/templates/vue/vite.config.ts.j2 +39 -0
  153. litestar_vite/templates/vue-inertia/env.d.ts.j2 +7 -0
  154. litestar_vite/templates/vue-inertia/index.html.j2 +14 -0
  155. litestar_vite/templates/vue-inertia/package.json.j2 +50 -0
  156. litestar_vite/templates/vue-inertia/resources/main.ts.j2 +18 -0
  157. litestar_vite/templates/vue-inertia/resources/pages/Home.vue.j2 +22 -0
  158. litestar_vite/templates/vue-inertia/resources/ssr.ts.j2 +21 -0
  159. litestar_vite/templates/vue-inertia/resources/style.css.j2 +21 -0
  160. litestar_vite/templates/vue-inertia/vite.config.ts.j2 +59 -0
  161. litestar_vite-0.15.0.dist-info/METADATA +230 -0
  162. litestar_vite-0.15.0.dist-info/RECORD +164 -0
  163. {litestar_vite-0.1.1.dist-info → litestar_vite-0.15.0.dist-info}/WHEEL +1 -1
  164. litestar_vite/config.py +0 -100
  165. litestar_vite/plugin.py +0 -45
  166. litestar_vite/template_engine.py +0 -103
  167. litestar_vite-0.1.1.dist-info/METADATA +0 -68
  168. litestar_vite-0.1.1.dist-info/RECORD +0 -11
  169. {litestar_vite-0.1.1.dist-info → litestar_vite-0.15.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,280 @@
1
+ """OpenAPI integration helpers for code generation.
2
+
3
+ This module centralizes Litestar private OpenAPI API usage so that the rest of
4
+ the codegen logic can remain stable and easier to reason about.
5
+ """
6
+
7
+ import contextlib
8
+ from dataclasses import dataclass
9
+ from typing import TYPE_CHECKING, Any, Protocol, cast
10
+
11
+ from litestar._openapi.datastructures import OpenAPIContext # pyright: ignore[reportPrivateUsage]
12
+ from litestar._openapi.schema_generation import SchemaCreator # pyright: ignore[reportPrivateUsage]
13
+ from litestar.handlers import HTTPRouteHandler
14
+ from litestar.openapi.spec import Reference, Schema
15
+ from litestar.response import Response as LitestarResponse
16
+ from litestar.response import Template
17
+ from litestar.response.base import ASGIResponse
18
+ from litestar.types.builtin_types import NoneType
19
+ from litestar.typing import FieldDefinition
20
+
21
+ if TYPE_CHECKING:
22
+ from litestar import Litestar
23
+ from litestar.dto import AbstractDTO
24
+
25
+
26
+ class _SchemaRegistryEntry(Protocol):
27
+ key: tuple[str, ...]
28
+
29
+
30
+ @dataclass(slots=True)
31
+ class OpenAPISupport:
32
+ """Best-effort access to Litestar OpenAPI internals.
33
+
34
+ Attributes:
35
+ openapi_schema: Exported OpenAPI schema dict (optional).
36
+ context: Litestar OpenAPIContext (optional).
37
+ schema_creator: Litestar SchemaCreator (optional).
38
+ """
39
+
40
+ openapi_schema: dict[str, Any] | None
41
+ context: OpenAPIContext | None
42
+ schema_creator: SchemaCreator | None
43
+
44
+ @classmethod
45
+ def from_app(cls, app: "Litestar", openapi_schema: dict[str, Any] | None) -> "OpenAPISupport":
46
+ """Create OpenAPISupport from a Litestar application.
47
+
48
+ Args:
49
+ app: Litestar application instance.
50
+ openapi_schema: Optional OpenAPI schema dict exported by Litestar.
51
+
52
+ Returns:
53
+ OpenAPISupport instance.
54
+ """
55
+ context, creator = try_create_openapi_context(app)
56
+ return cls(openapi_schema=openapi_schema, context=context, schema_creator=creator)
57
+
58
+ @property
59
+ def enabled(self) -> bool:
60
+ """Whether OpenAPI support is available.
61
+
62
+ Returns:
63
+ True if OpenAPI support is available, otherwise False.
64
+ """
65
+ return self.context is not None and self.schema_creator is not None
66
+
67
+
68
+ def try_create_openapi_context(app: "Litestar") -> tuple[OpenAPIContext | None, SchemaCreator | None]:
69
+ """Create OpenAPIContext and SchemaCreator if available.
70
+
71
+ This mirrors Litestar's internal OpenAPI setup but is tolerant of missing
72
+ configuration or internal API changes.
73
+
74
+ Args:
75
+ app: Litestar application instance.
76
+
77
+ Returns:
78
+ Tuple of (OpenAPIContext or None, SchemaCreator or None).
79
+ """
80
+ openapi_config = app.openapi_config
81
+ if openapi_config is None:
82
+ return None, None
83
+
84
+ with contextlib.suppress(AttributeError, TypeError, ValueError):
85
+ openapi_context = OpenAPIContext(
86
+ openapi_config=openapi_config, # pyright: ignore[reportUnknownMemberType]
87
+ plugins=app.plugins.openapi, # pyright: ignore[reportUnknownMemberType]
88
+ )
89
+ return openapi_context, SchemaCreator.from_openapi_context(openapi_context)
90
+
91
+ return None, None
92
+
93
+
94
+ def openapi_components_schemas(openapi_schema: dict[str, Any] | None) -> dict[str, Any]:
95
+ """Extract OpenAPI components.schemas dict as a concrete mapping.
96
+
97
+ Returns:
98
+ The components.schemas mapping, or an empty dict if unavailable.
99
+ """
100
+ if not isinstance(openapi_schema, dict):
101
+ return {}
102
+ components = openapi_schema.get("components")
103
+ if not isinstance(components, dict):
104
+ return {}
105
+ schemas = cast("dict[str, Any]", components).get("schemas")
106
+ if not isinstance(schemas, dict):
107
+ return {}
108
+ return cast("dict[str, Any]", schemas)
109
+
110
+
111
+ def merge_generated_components_into_openapi(
112
+ openapi_schema: dict[str, Any], generated_components: dict[str, Schema]
113
+ ) -> None:
114
+ """Merge generated component schemas into an OpenAPI document."""
115
+ components_any = openapi_schema.get("components")
116
+ if not isinstance(components_any, dict):
117
+ openapi_schema["components"] = {}
118
+ components_any = openapi_schema["components"]
119
+
120
+ components_dict = cast("dict[str, Any]", components_any)
121
+ schemas_any = components_dict.get("schemas")
122
+ if not isinstance(schemas_any, dict):
123
+ components_dict["schemas"] = {}
124
+ schemas_any = components_dict["schemas"]
125
+
126
+ schemas_dict = cast("dict[str, Any]", schemas_any)
127
+ for component_name, schema in generated_components.items():
128
+ if component_name not in schemas_dict:
129
+ schemas_dict[component_name] = schema.to_schema()
130
+
131
+
132
+ def build_schema_name_map(schema_registry: Any) -> dict[tuple[str, ...], str]:
133
+ """Build a mapping of schema registry keys to final component names.
134
+
135
+ Uses the same shortening and de-duplication logic as
136
+ ``SchemaRegistry.generate_components_schemas()``.
137
+
138
+ Args:
139
+ schema_registry: Litestar schema registry.
140
+
141
+ Returns:
142
+ Mapping of schema keys to component names.
143
+ """
144
+ name_map: dict[tuple[str, ...], str] = {}
145
+ try:
146
+ model_name_groups = schema_registry._model_name_groups
147
+ except AttributeError:
148
+ model_name_groups = {}
149
+ if not isinstance(model_name_groups, dict):
150
+ return name_map
151
+
152
+ groups_dict = cast("dict[str, Any]", model_name_groups)
153
+ for name, group_any in groups_dict.items():
154
+ group = cast("list[Any]", group_any)
155
+ if len(group) == 1:
156
+ registered_schema: _SchemaRegistryEntry = group[0]
157
+ name_map[registered_schema.key] = name
158
+ continue
159
+
160
+ full_keys: list[tuple[str, ...]] = []
161
+ for registered_schema_any in group:
162
+ entry_key: _SchemaRegistryEntry = registered_schema_any
163
+ full_keys.append(entry_key.key)
164
+
165
+ shortened_keys: list[tuple[str, ...]] = list(schema_registry.remove_common_prefix(full_keys))
166
+ names = ["_".join(k) for k in shortened_keys]
167
+
168
+ for name_, registered_schema_any in zip(names, group, strict=False):
169
+ entry_name: _SchemaRegistryEntry = registered_schema_any
170
+ name_map[entry_name.key] = name_
171
+
172
+ return name_map
173
+
174
+
175
+ def schema_name_from_ref(ref: str) -> str:
176
+ """Return the OpenAPI component name from a schema $ref string.
177
+
178
+ Returns:
179
+ The schema name part of the reference.
180
+ """
181
+ return ref.rsplit("/", maxsplit=1)[-1]
182
+
183
+
184
+ def _filter_response_types_from_union(field_definition: FieldDefinition) -> FieldDefinition | None:
185
+ """Filter out ASGIResponse subtypes from a union type.
186
+
187
+ For union types like `InertiaRedirect | NoProps`, this filters out the response
188
+ types (InertiaRedirect) and returns only the props types (NoProps).
189
+
190
+ Args:
191
+ field_definition: The field definition to filter.
192
+
193
+ Returns:
194
+ Filtered FieldDefinition with response types removed, or None if all types are responses.
195
+ """
196
+ # Not a union - return as-is (caller handles response type check)
197
+ if not field_definition.is_union:
198
+ return field_definition
199
+
200
+ # Filter inner types, keeping only non-response types
201
+ # IMPORTANT: Check order matters! LitestarResponse is a subclass of ASGIResponse,
202
+ # so we must check LitestarResponse FIRST to extract inner types before the
203
+ # general ASGIResponse check skips it entirely.
204
+ props_types: list[type] = []
205
+ for inner in field_definition.inner_types:
206
+ # Skip None types
207
+ if inner.is_subclass_of(NoneType):
208
+ continue
209
+ # For LitestarResponse[T], extract T as the props type
210
+ if inner.is_subclass_of(LitestarResponse):
211
+ if inner.inner_types:
212
+ props_types.append(inner.inner_types[0].annotation)
213
+ continue
214
+ # Skip other ASGIResponse subtypes (Redirect, etc.)
215
+ if inner.is_subclass_of(ASGIResponse):
216
+ continue
217
+ props_types.append(inner.annotation)
218
+
219
+ if not props_types:
220
+ return None
221
+ if len(props_types) == 1:
222
+ return FieldDefinition.from_annotation(props_types[0])
223
+
224
+ # Sort types by qualified name for deterministic union construction
225
+ # This prevents cache key inconsistencies from type ordering
226
+ props_types.sort(key=lambda t: getattr(t, "__qualname__", str(t)))
227
+
228
+ # Rebuild union type
229
+ from typing import Union
230
+
231
+ union_type = Union[tuple(props_types)] # type: ignore[valid-type] # noqa: UP007
232
+ return FieldDefinition.from_annotation(union_type)
233
+
234
+
235
+ def resolve_page_props_field_definition(
236
+ handler: HTTPRouteHandler, schema_creator: SchemaCreator
237
+ ) -> tuple[FieldDefinition | None, Schema | Reference | None]:
238
+ """Resolve FieldDefinition and schema result for a handler's response.
239
+
240
+ Mirrors Litestar's response schema generation to ensure consistent schema registration.
241
+ Filters out ASGIResponse subtypes from union types.
242
+
243
+ Args:
244
+ handler: HTTP route handler.
245
+ schema_creator: Litestar SchemaCreator.
246
+
247
+ Returns:
248
+ Tuple of (FieldDefinition or None, Schema/Reference or None).
249
+ """
250
+ original_field = handler.parsed_fn_signature.return_type
251
+
252
+ # Filter response types from unions (e.g., InertiaRedirect | NoProps -> NoProps)
253
+ field_definition = _filter_response_types_from_union(original_field)
254
+ if field_definition is None:
255
+ return None, None
256
+
257
+ if field_definition.is_subclass_of((NoneType, ASGIResponse)):
258
+ return None, None
259
+
260
+ resolve_return_dto: Any = None
261
+ with contextlib.suppress(AttributeError):
262
+ resolve_return_dto = cast("Any", handler).resolve_return_dto
263
+ dto = resolve_return_dto() if callable(resolve_return_dto) else None
264
+ if dto is not None:
265
+ dto_t = cast("type[AbstractDTO[Any]]", dto)
266
+ result = dto_t.create_openapi_schema(
267
+ field_definition=field_definition, handler_id=handler.handler_id, schema_creator=schema_creator
268
+ )
269
+ return field_definition, result
270
+
271
+ if field_definition.is_subclass_of(Template):
272
+ resolved_field = FieldDefinition.from_annotation(str)
273
+ elif field_definition.is_subclass_of(LitestarResponse):
274
+ resolved_field = (
275
+ field_definition.inner_types[0] if field_definition.inner_types else FieldDefinition.from_annotation(Any)
276
+ )
277
+ else:
278
+ resolved_field = field_definition
279
+
280
+ return resolved_field, schema_creator.for_field_definition(resolved_field)