mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-10-31 15:06:42 +00:00 
			
		
		
		
	Merge pull request #673 from A-kirami/dev
从 Fastapi 的文档中排除驱动器的 HTTP 上报地址
This commit is contained in:
		| @@ -76,6 +76,16 @@ class Config(BaseSettings): | |||||||
|  |  | ||||||
|       ``redoc`` 地址,默认为 ``None`` 即关闭 |       ``redoc`` 地址,默认为 ``None`` 即关闭 | ||||||
|     """ |     """ | ||||||
|  |     fastapi_include_adapter_schema: bool = True | ||||||
|  |     """ | ||||||
|  |     :类型: | ||||||
|  |  | ||||||
|  |       ``bool`` | ||||||
|  |  | ||||||
|  |     :说明: | ||||||
|  |  | ||||||
|  |       是否包含适配器路由的 schema,默认为 ``True`` | ||||||
|  |     """ | ||||||
|     fastapi_reload: bool = False |     fastapi_reload: bool = False | ||||||
|     """ |     """ | ||||||
|     :类型: |     :类型: | ||||||
| @@ -179,6 +189,7 @@ class Driver(ReverseDriver): | |||||||
|             _handle, |             _handle, | ||||||
|             name=setup.name, |             name=setup.name, | ||||||
|             methods=[setup.method], |             methods=[setup.method], | ||||||
|  |             include_in_schema=self.fastapi_config.fastapi_include_adapter_schema, | ||||||
|         ) |         ) | ||||||
|  |  | ||||||
|     @overrides(ReverseDriver) |     @overrides(ReverseDriver) | ||||||
|   | |||||||
| @@ -82,6 +82,12 @@ DRIVER=~fastapi | |||||||
| 默认值: `None`   | 默认值: `None`   | ||||||
| 说明: `FastAPI` 提供的 `ReDoc` 文档地址,如果为 `None`,则不提供 `ReDoc` 文档。 | 说明: `FastAPI` 提供的 `ReDoc` 文档地址,如果为 `None`,则不提供 `ReDoc` 文档。 | ||||||
|  |  | ||||||
|  | ##### `fastapi_include_adapter_schema` | ||||||
|  |  | ||||||
|  | 类型: `bool`   | ||||||
|  | 默认值: `True`   | ||||||
|  | 说明: `FastAPI` 提供的 `OpenAPI` JSON 定义中是否包含适配器路由的 `Schema`。 | ||||||
|  |  | ||||||
| ##### `fastapi_reload` | ##### `fastapi_reload` | ||||||
|  |  | ||||||
| 类型: `bool`   | 类型: `bool`   | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user