Skip to content

Add the `deprecated` attribute to `Endpoint` class

4ac8721
Select commit
Loading
Failed to load commit list.
Open

Add the deprecated attribute to Endpoint class #1413

Add the `deprecated` attribute to `Endpoint` class
4ac8721
Select commit
Loading
Failed to load commit list.
Knope Bot / Require changes to be documented required action Mar 11, 2026

This pull request has not been documented yet

This project requires changes to be documented via either changesets or conventional commits. Depending on how this pull request is merged, it may not be fully documented:

  • ❌ Squash merging is allowed, but the title is not a conventional commit
  • ✅ Merge commits are disabled
  • ✅ Rebase merging is disabled

You can either correct the above issues, or use a change file to document this pull request. knope-bot can't auto-generate a change file for this pull request. Instead, you can document the change manually by creating a change file with Knope or following these instructions:

  1. Create a file named .changeset/add_the_deprecated_attribute_to_endpoint_class.md
  2. Copy and paste the below Markdown into the file
  3. Replace "CHANGE_TYPE" with major, minor, or patch (see knope's docs for what those mean)
  4. Edit the content as needed to be applicable to users of the project (not maintainers)

Details

---
default: CHANGE_TYPE
---

# Add the `deprecated` attribute to `Endpoint` class

#1413 by @nimeshnayaju

Currently, the `deprecated` field from the OpenAPI schema's Operation is not passed through to the `Endpoint` dataclass that templates use. The Operation schema does parse it ([operation.py#31](https://github.com/openapi-generators/openapi-python-client/blob/75cb057e19de30f745eb0831d8e9e9fb7f9e0378/openapi_python_client/schema/openapi_schema_pydantic/operation.py#L31)), but the Endpoint dataclass ([`openapi.py#L132-L152`](https://github.com/openapi-generators/openapi-python-client/blob/75cb057e19de30f745eb0831d8e9e9fb7f9e0378/openapi_python_client/parser/openapi.py#L132-L151)) doesn't include it, and it's not set during construction. This PR adds this field to the `Endpoint` class.

Fixes https://github.com/openapi-generators/openapi-python-client/issues/1412