Skip to content

Commit

Permalink
Merge pull request #29 from community-of-python/disable-offline-docs
Browse files Browse the repository at this point in the history
Disable offline docs by default
  • Loading branch information
vrslev authored Oct 11, 2024
2 parents 15e91e5 + 377c16b commit e5d20cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion microbootstrap/instruments/swagger_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SwaggerConfig(BaseInstrumentConfig):
service_static_path: str = "/static"

swagger_path: str = "/docs"
swagger_offline_docs: bool = True
swagger_offline_docs: bool = False
swagger_extra_params: dict[str, typing.Any] = pydantic.Field(default_factory=dict)


Expand Down
6 changes: 3 additions & 3 deletions tests/instruments/test_swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def test_swagger_teardown(


def test_litestar_swagger_bootstrap_online_docs(minimal_swagger_config: SwaggerConfig) -> None:
minimal_swagger_config.swagger_offline_docs = False
swagger_instrument: typing.Final = LitestarSwaggerInstrument(minimal_swagger_config)

swagger_instrument.bootstrap()
Expand All @@ -53,6 +52,7 @@ def test_litestar_swagger_bootstrap_online_docs(minimal_swagger_config: SwaggerC


def test_litestar_swagger_bootstrap_offline_docs(minimal_swagger_config: SwaggerConfig) -> None:
minimal_swagger_config.swagger_offline_docs = True
swagger_instrument: typing.Final = LitestarSwaggerInstrument(minimal_swagger_config)

swagger_instrument.bootstrap()
Expand All @@ -72,7 +72,6 @@ async def test_litestar_swagger_bootstrap_working_online_docs(
minimal_swagger_config: SwaggerConfig,
) -> None:
minimal_swagger_config.swagger_path = "/my-docs-path"
minimal_swagger_config.swagger_offline_docs = False
swagger_instrument: typing.Final = LitestarSwaggerInstrument(minimal_swagger_config)

swagger_instrument.bootstrap()
Expand All @@ -89,6 +88,7 @@ async def test_litestar_swagger_bootstrap_working_offline_docs(
minimal_swagger_config: SwaggerConfig,
) -> None:
minimal_swagger_config.service_static_path = "/my-static-path"
minimal_swagger_config.swagger_offline_docs = True
swagger_instrument: typing.Final = LitestarSwaggerInstrument(minimal_swagger_config)

swagger_instrument.bootstrap()
Expand Down Expand Up @@ -116,7 +116,6 @@ async def test_fastapi_swagger_bootstrap_working_online_docs(
minimal_swagger_config: SwaggerConfig,
) -> None:
minimal_swagger_config.swagger_path = "/my-docs-path"
minimal_swagger_config.swagger_offline_docs = False
swagger_instrument: typing.Final = FastApiSwaggerInstrument(minimal_swagger_config)

swagger_instrument.bootstrap()
Expand All @@ -133,6 +132,7 @@ async def test_fastapi_swagger_bootstrap_working_offline_docs(
minimal_swagger_config: SwaggerConfig,
) -> None:
minimal_swagger_config.service_static_path = "/my-static-path"
minimal_swagger_config.swagger_offline_docs = True
swagger_instrument: typing.Final = FastApiSwaggerInstrument(minimal_swagger_config)
fastapi_application = fastapi.FastAPI(
**swagger_instrument.bootstrap_before(),
Expand Down

0 comments on commit e5d20cc

Please sign in to comment.