Repository: poem-web/poem (language: rust)

Issue:
Changing OneOf to Union breaks semver
## Expected Behavior

`OneOf` still works and is marked as deprecated. Please make it an alias of `Union`. Same with the `oai` field `property_name`, which now seems to be `discriminator_name`.


Alternatively, bump the major version. 🙂 

## Actual Behavior

Build errors.

## Steps to Reproduce the Problem

1. Build anything using OneOf after updating to the most recent version, haha.

## Specifications

- Version: 1.2.36
- Platform:
- Subsystem: 


Discussion / hints:
This is a small change. 😂
In fact, the previous implementation of `OneOf` was not correct, so I refactored it, and now it is `any_of` by default, unless the `one_of` attribute is specified, which will lose some performance.
I understand, but that's why I'm suggesting deprecating it in code so instead of a build error, I get angry warnings to change.

Once the API is public, changes like this will break stuff in production and we don't always have time to fix these small things when trying to fix other things. This is what semver guarantees are for: if a change would break the build, it should be a major version bump. I have no problem with it being a major version bump and using poem-openapi v582.0.1 in 2 weeks time, I just like knowing that when a patch version increments it's not going to break the build, hehe. :)
Aha, I see. If it is a breaking change due to being incorrect, then it's a valid break but the migration path should be documented in the change log to simplify the process. I had to read the commits to understand what to change. :D
So the previous name `OneOf` was not suitable, and now non-object members can be supported:

```rust
#[derive(Union)]
struct MyObj {
     A(i32),
     B(ObjB), // <<--- a object
}
````
I'm so sorry, I really don't want to make breaking changes. 😂

Fix patch:
diff --git a/poem-openapi/CHANGELOG.md b/poem-openapi/CHANGELOG.md
index 931d32e73d..6b8bb1b798 100644
--- a/poem-openapi/CHANGELOG.md
+++ b/poem-openapi/CHANGELOG.md
@@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 - Add `HashSet` and `BTreeSet` support to OpenAPI. [#167](https://github.com/poem-web/poem/pull/167)
 - Add `Url` support to OpenAPI. [#168](https://github.com/poem-web/poem/pull/168)
-- Remove `OneOf` macro and add `Union` macro.
+- **Breaking change:** Remove `OneOf` macro and add `Union` macro, and replace `property_name` with `discriminator_name`.
+  - The implementation of `OneOf` was incorrect. To migrate, change all instances of `OneOf` to `Union`, and all instances of `property_name` to `discriminator_name`.
 
 # [1.2.34] 2022-1-14
 


Test patch: