Skip to content

Conversation

wallagib
Copy link
Contributor

Changed behavior from using the term x_type_0 to x_type_y if x is a Schema that defines a Title property string y.

This provides an easier interface for understanding what users are importing, as well as less reliance on the ordering of the schema.

@wallagib wallagib force-pushed the use-descriptive-type-names branch from 7ba5370 to 725c4c8 Compare February 14, 2024 15:39
@wallagib wallagib changed the title Use "Type<Title>" instead of "Type<Index>" if available feat!:Use "Type<Title>" instead of "Type<Index>" if available Feb 14, 2024
@dbanty dbanty added the 🥚breaking This change breaks compatibility label Feb 19, 2024
@wallagib wallagib force-pushed the use-descriptive-type-names branch from 725c4c8 to 85350a7 Compare February 19, 2024 04:46
@wallagib
Copy link
Contributor Author

Force-pushed a linting fix

Changed behavior from using the term `x_type_0` to `x_type_y` if x is a Schema that defines a Title property string `y`.

This provides an easier interface for understanding what users are importing, as well as less reliance on the ordering of the schema.

BREAKING CHANGE: The name of imports will change if the Schema they were built on previously used Title properties on fields within a oneOf Union.
@dbanty
Copy link
Collaborator

dbanty commented Aug 17, 2025

Rebased and expanded usage a bit with #1301. Thanks for the original PR, and sorry for the very long delay!

@dbanty dbanty closed this Aug 17, 2025
dbanty added a commit that referenced this pull request Aug 17, 2025
Replaces #962 with a rebase & a couple tweaks

Co-authored-by: Gibryon Bhojraj <[email protected]>
@knope-bot knope-bot bot mentioned this pull request Aug 17, 2025
@knope-bot knope-bot bot mentioned this pull request Aug 26, 2025
github-merge-queue bot pushed a commit that referenced this pull request Aug 26, 2025
> [!IMPORTANT]
> Merging this pull request will create this release

## Breaking Changes

### Change some union variant names

When creating a union with `oneOf`, `anyOf`, or a list of `type`, the
name of each variant used to be `type_{index}`
where the index is based on the order of the types in the union.

This made some modules difficult to understand, what is a
`my_type_type_0` after all?
It also meant that reordering union members, while not a breaking change
to the API, _would_ be a breaking change
for generated clients.

Now, if an individual variant has a `title` attribute, that `title` will
be used in the name instead.
This is only an enhancement for documents which use `title` in union
variants, and only a breaking change for
_inline models_ (not `#/components/schemas` which should already have
used more descriptive names).

Thanks @wallagib for PR #962!

## Features

### Support patterned and default HTTP statuses

HTTP statuses like `2XX` and `default` are now supported!

A big thank you to:
- @PSU3D0 for PR #973 (eons ago 😅)
- @obs-gh-peterkolloch for PR #1300
- @goodsonjr for PR #1304

Closes #1271 and #832

> [!NOTE]
> Custom template users: the `endpoint.responses` type has changed quite
a bit. Check out #1303 for the changes.

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🥚breaking This change breaks compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants