mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 21:12:16 +00:00
* This change creates a PR * start moving stuff around * data_models/_category_.json * reference/_category_.json * moving some stuff around * Introduction * Documentation updates * few broken links, clean up sidebar titles for how-to * codespell * quickstart - new provider extension * add a comment * map provider interface * quickstart for new router extension * [Docs] diataxis refactor refactor (#6425) * Start refactor * Edits * [DOCS] Reorganize and edit. Fix sidebar navigation (#6445) * Reorganize and edit. Fix sidebar navigation * Fix broken linkages * Edit --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * Fix links --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Fix broken links * Reword CLA part in the Licensing FAQ * change titles and order suggestion - cc @IgorWounds @piiq --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: hjoaquim <henriquecjoaquim@gmail.com>
55 lines
1.9 KiB
Plaintext
Vendored
55 lines
1.9 KiB
Plaintext
Vendored
---
|
|
title: Deprecating Endpoints
|
|
sidebar_position: 11
|
|
description: This guide provides detailed instructions on how to deprecate an endpoint in the OpenBB Platform.
|
|
keywords:
|
|
- OpenBB community
|
|
- OpenBB Platform
|
|
- Custom commands
|
|
- API
|
|
- Python Interface
|
|
- Deprecation
|
|
- Deprecated
|
|
---
|
|
|
|
import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
|
|
|
|
<HeadTitle title="Deprecating Endpoints - How-To | OpenBB Platform Docs" />
|
|
|
|
Deprecating commands is essential to maintaining the OpenBB Platform. This guide outlines the process for deprecating an endpoint.
|
|
|
|
## Deprecating an endpoint
|
|
|
|
1. Add the new endpoint that will replace the deprecated one.
|
|
|
|
2. Add the deprecation warning
|
|
|
|
Navigate to the **router** where the endpoint to be deprecated exists. Set the `deprecated` flag to `True` and add `deprecation=OpenBBDeprecationWarning(…)` argument to the decorator. Refer to the example below:
|
|
|
|
```python
|
|
|
|
from openbb_core.app.deprecation import OpenBBDeprecationWarning
|
|
|
|
@router.command(
|
|
model="MarketIndices",
|
|
deprecated=True,
|
|
deprecation=OpenBBDeprecationWarning(
|
|
message="This endpoint is deprecated; use `/index/price/historical` instead.",
|
|
since=(4, 1),
|
|
expected_removal=(4, 5),
|
|
),
|
|
)
|
|
async def market(
|
|
cc: CommandContext,
|
|
provider_choices: ProviderChoices,
|
|
standard_params: StandardParams,
|
|
extra_params: ExtraParams,
|
|
) -> OBBject:
|
|
"""Historical Market Indices."""
|
|
return await OBBject.from_query(Query(**locals()))
|
|
```
|
|
|
|
3. Get approval from a OpenBB Platform maintainer: We will help you determine the appropriate version for the deprecation warning, and communicate the change(s) to the relevant personnel that might depend on the endpoint you are deprecating.
|
|
|
|
4. Remove as we say - the endpoint will be removed in the version specified in the deprecation warning.
|