You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenAPI only lets you have one error per HTTP response code. This
is a problem when converting things because Smithy has no such
limitation. To address that, we added a toggle that lets you
disambiguate by making the body contents a `oneOf`, which is an
untagged union. The problem is that we made this a tagged union by
leaning on how Smithy converts Smithy's union shape, which is tagged.
To illustrate the problem, the OpenAPI modeled body technically now
declares the following body valid:
```json
{
"Error1" {
"foo": "bar"
}
}
```
But the model for the structure is:
```
@error("client")
@HttpError(400)
structure Error1 {
foo: String
}
```
And an actual valid body would be:
```json
{
"foo": "bar"
}
```
This commit turns the OpenAPI body into an untagged union instead,
which is how it should be.
Copy file name to clipboardExpand all lines: smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1Protocol.java
Copy file name to clipboardExpand all lines: smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/protocols/error-code-collision-test-use-oneof.openapi.json
0 commit comments